September 3rd, 2000, 07:39 PM
I get "Not a valid MySql Resource on line bla bla (line were the result is evaled)of filebla". My SQL query is correct. I've tried both ways of connecting to mysql (using select db and mysql_query instead of mysql_db_query)
$id_link = mysql_connect('localhost','username','password');
$db = "boham";
$sql = "select * from testaffiliate where username = '$PHP_AUTH_USER' and password = '$PHP_AUTH_PW'";
$result = mysql_db_query($db,$sql,$id_link) | | die("Cannot execute SQl query");
if ($row = mysql_fetch_array($result))
any help or ideas would be greatly appreciated!!
September 4th, 2000, 01:48 AM
Anybody? I'm sooooo stuck!!!!
September 4th, 2000, 02:00 AM
Try maybe something like this:
#Connecting to the database
$db=mysql_connect($host,$username,$password) or Die("Unable to connect to the database, Please try later");
mysql_select_db($database,$db,$password) or die("Unable to Select Database, Please try later");
$sql="select * from testaffiliate where username = '$PHP_AUTH_USER' and password = '$PHP_AUTH_PW'";
** Expertise comes with experiece ** Nikunj
[This message has been edited by nikunj (edited September 04, 2000).]
September 4th, 2000, 02:16 AM
I still get the same error. What can it be? I am soooo completely stuck. (if it helps, I'm using PHP-4)
September 4th, 2000, 09:16 AM
I *think* it might be because you're not assigning the result of mysql_select_db() to a variable, even if you don't then use it...
works for me.