RE: [PHP] Num rows error

From: Date: Wed, 11 Oct 2000 00:13:38 +0000
Subject: RE: [PHP] Num rows error
Groups: php.general 
Request: Send a blank email to php-general+get-19435@lists.php.net to get a copy of this message
> I have already connected, and this is just a snippet. > > > $check = "SELECT * FROM list WHERE email = '$email'"; > > > $query = mysql_query($check); ^ There really should be a second parameter to mysql_query that specifies the mysql connection to use. After you use mysql_(p)connect, try a mysql_error(). This really should be inside an if, ie: if ($mysql = mysql_connect($server, $user, $pass)) { if ($select = mysql_select_db("databasename", $mysql)) { $check = "SELECT * FROM list WHERE email = '$email'"; $query = mysql_query($check, $mysql); } else { echo mysql_error(); } } else { echo mysql_error(); } Jason

« previous php.general (#19435) next »