BazzA
05-20-2001, 10:56 PM
hi all
A little while back I asked your advice on what route to take for web-databases. I ended up with PHP and mySQL (thank god for free stuff! :))
Admittedly I haven't done much with it since I decided what I wanted to do so I'm still messing around with the basics of database connectivity.
anyway....
here's the bit of code causing me grief:
$db_name = "2VAG";
$table_name = "_1015";
$con = @mysql_connect("main", "admin", "imgonnatellyou") || die ("Couldn't connect.");
echo $con;
$db = mysql_select_db($db_name, $con) || die ("Couldn't select database.");
even though the echo bit gives me a 1 (which is 'true', right?) I get this error when I run the code:
Warning: Supplied argument is not a valid MySQL-Link resource in C:/XITAMI/webpages/php/do_addrecord.php on line 13
Couldn't select database.
I can't see the problem with this simple piece of code. I can access the database fine though the mySQL console...
any ideas? am I being really silly?
thanks
BazzA
A little while back I asked your advice on what route to take for web-databases. I ended up with PHP and mySQL (thank god for free stuff! :))
Admittedly I haven't done much with it since I decided what I wanted to do so I'm still messing around with the basics of database connectivity.
anyway....
here's the bit of code causing me grief:
$db_name = "2VAG";
$table_name = "_1015";
$con = @mysql_connect("main", "admin", "imgonnatellyou") || die ("Couldn't connect.");
echo $con;
$db = mysql_select_db($db_name, $con) || die ("Couldn't select database.");
even though the echo bit gives me a 1 (which is 'true', right?) I get this error when I run the code:
Warning: Supplied argument is not a valid MySQL-Link resource in C:/XITAMI/webpages/php/do_addrecord.php on line 13
Couldn't select database.
I can't see the problem with this simple piece of code. I can access the database fine though the mySQL console...
any ideas? am I being really silly?
thanks
BazzA