Hi.
I am trying to design a page with the main content and sidebar dynamic with MySQL and PHP. The below code is what I use to connect and echo the contents (well except for my user,pass,db name etc).
PHP Code:
<?
$con = mysql_connect("mysql.server.com","joe","soap");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_database", $con);
$result = mysql_query("SELECT * FROM abc");
$row = mysql_fetch_array($result);
echo "This is: <br> ".$row['fld_Content']."<br>".$row['fld_Sidebar']." ";
?>
However this error keeps coming up.
Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Has this got something to do with the PHP.INI file ? Or something in my code?
// If it the php.ini file, how can i fix it?
Thanks!~
Bookmarks