RE: [PHP] redirect if sql = nothing
| From: | Wizaerd) | Date: | Tue, 20 Feb 2001 16:46:23 +0000 |
| Subject: | RE: [PHP] redirect if sql = nothing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40766@lists.php.net to get a copy of this message | ||
Actually this won't work since the actual query never runs....
try:
$sql = "select * from table where bla bla bla";
$rResults = mysql_query( $sql, $dbConnection );
if( mysql_num_rows($rResults) == 0 ) {
do this;} else {
do this;} At 11:52 AM 2/20/01 -0500, Brian V Bonini wrote:
$sql = "select * from table where bla bla bla"; if(!isset($sql)) {do this;} else {do this;} I think.... ? -Brian ************** -----Original Message----- From: Matt Davis [mailto:matt@roundyourway.co.uk] Sent: Tuesday, February 20, 2001 11:33 AM To: Php Mailing List Subject: [PHP] redirect if sql = nothing If my SQL returns no results then i want to redirect to a page saying no results etc but if results are found then I want it to continue on down the script how would i do this. Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net