Re: redirect if sql = nothing

From: Date: Tue, 20 Feb 2001 16:48:18 +0000
Subject: Re: redirect if sql = nothing
Groups: php.general 
Request: Send a blank email to php-general+get-40765@lists.php.net to get a copy of this message
In a message dated 20/02/2001 16:42:51 GMT Standard Time, brian@gfx.cncdsl.com writes: << $sql = "select * from table where bla bla bla"; if(!isset($sql)) { do this; } else { do this; } I think.... ? -Brian >> This way might be a little easier $sql = "select * from table where bla bla bla"; $num_rows = mysql_num_rows($sql); if ($num_rows==0){ header ("Location: Http://www.YOURURL.com/"); } Although depending on the rest of your script the header may have already been sent in which case it won`t work. HTH Ade

« previous php.general (#40765) next »