Just got a new site and already I've hit a brick wall.
I used cPanelX to create a new MySQL database called "mydb." (It is thereafter called "artpros_mydb" in cPanel and in phpMyAdmin. ) An employees table was added. It contains an id and four fields.
I'm using the following script within an html page to generate the results.
<?php
$db = mysql_connect("localhost", "artpros_mydb");
mysql_select_db("mydb",$db);
$result = mysql_query("SELECT * FROM employees",$db);
printf("First Name: %s<br>\n", mysql_result($result,0,"first"));
printf("Last Name: %s<br>\n", mysql_result($result,0,"last"));
printf("Address: %s<br>\n", mysql_result($result,0,"address"));
printf("Position: %s<br>\n", mysql_result($result,0,"position"));
?>
But, it fails.
The error message I receive for each printf is:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in home/artpros/public_html/test.php on line [nn] [fieldname]
I'm sure this problem is trivial, but I'm stumped. Hey, I'm a Newbie!
Bill