View Single Post
Old 08-22-2002, 10:49 PM   PM User | #1
tvollmer
New to the CF scene

 
Join Date: Aug 2002
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
tvollmer is an unknown quantity at this point
Unhappy Could someone please tell me what I did wrong?

Here is a script I have started working on.
My web host uses PHP 4.2.2 and MySql 3.23.51

<?

// Database Variables

$server = "localhost";
$database = "tsdbase";
$username = "frank";
$password = "chicken";
$table = "names";

// Connect to Database

$db = mysql_connect($server,$username,$password,$database);

$res = mysql_query("SELECT * FROM $table", $db);

$data = mysql_fetch_array($res);

?>

When I run the script, I get the following error :

"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource"

What am I doing wrong?
All I want to do is to open a database and display a table to the browser.

Todd

Last edited by tvollmer; 08-22-2002 at 10:52 PM..
tvollmer is offline   Reply With Quote