[web] Invalid resource from mysql_query

Started by
0 comments, last by evolutional 19 years, 5 months ago
With this code:

$link = mysql_connect("freelinuxhost.com",$username,$password);
@mysql_select_db($database, $link) or die( "Unable to select database");

$query = "INSERT INTO Entry VALUES ('$name','$date','$quote')";
$result = mysql_query($query, $link) or die(mysql_error());

$num = mysql_affected_rows();

mysql_close();

$arr = mysql_fetch_row($result);
I get the error: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource
//------------------------------------------------------------------------------------------------------The great logician Bertrand Russell once claimed that he could prove anything if given that 1+1=1. So one day, some fool asked him, "Ok. Prove that you're the Pope." He thought for a while and proclaimed, "I am one. The Pope is one. Therefore, the Pope and I are one."
Advertisement
You closed the connection to mysql before executing mysql_fetch_row - it's likely that's the culprit (from my rusty php knowledge)

This topic is closed to new replies.

Advertisement