RE: [PHP] redirect if sql = nothing
| From: | Matt Davis | Date: | Tue, 20 Feb 2001 17:03:55 +0000 |
| Subject: | RE: [PHP] redirect if sql = nothing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40767@lists.php.net to get a copy of this message | ||
I have put this code in but its not making any difference
if ($num==0) {
header("location:
http://www.***********/0/cambridgeshire/_shared/database_files/php_files/nor
esults.htm");
} else {;
}
Matt.
-----Original Message-----
From: Joe Sheble (Wizaerd) [mailto:JustForMailingLists@wizaerd.com]
Sent: 20 February 2001 16:46
To: brian@gfx.cncdsl.com; matt@roundyourway.co.uk; Php Mailing List
Subject: RE: [PHP] redirect if sql = nothing
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
--
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