Helpful Information
Category: Quick PGP
Quick PGP -> Mysql Question

$rs = @mysql_select_db("dvd_trader", $conn) or die("Err:Db");
$sql="select imdb_id from movie_info where imdb_id =".$imdbid;

Just basically want help writing a if staement saying if it found something do fucnction x else do function y.

Sorry if this is a bit simple but just getting into scripting and the docs were a bit overwhelming for me.

Any help appreciated.


if (mysql_num_rows($rs) > 0) { // If there are rows returned
*** Do This ***;
else {
*** Do Something Else ***;

You also should use a different variable name for the DB select and the query statements.

Ahh thanks.