Date: 10/21/00
- Next message: Arno A. Karner: "Re: [phplib] Returning an error message"
- Previous message: Peter Bowyer: "[phplib] Returning an error message"
- In reply to: Peter Bowyer: "[phplib] Returning an error message"
- Next in thread: Arno A. Karner: "Re: [phplib] Returning an error message"
- Reply: Arno A. Karner: "Re: [phplib] Returning an error message"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
after the query check for
if ($db->nf() == 0) {
die("That ID does not exist!");
}
Maurice
NOXX.COM
----- Original Message -----
From: "Peter Bowyer" <reywob <email protected>>
To: <phplib <email protected>>
Sent: Saturday, October 21, 2000 11:05 AM
Subject: [phplib] Returning an error message
> Hi,
>
> I have the following piece of code in a script:
> $query = "SELECT * FROM $tbl_name where id=".$id;
> $db->query($query);
>
> My problem is if the ID doesn't exist, it doesn't return an error, and
just
> carries on printing the page without any code in it. See what I mean at
> <http://www.sendcard.f2s.com/demo/sendcard.php?view=1&id=1234>
>
> This gives the user no indication of what is wrong. How can I check
> whether the $db->query($query); has extracted a row from the database or
> not? Does $db return 0 or something?
>
> Thanks,
> Peter.
> --oOo--
> Narrow Gauge on the web - photos, directory and forums!
> http://www.narrowgauge.f2s.com
> --oOo--
> Peter's web page - Scottish narrow gauge in 009
> http://members.aol.com/reywob/
> --oOo--
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Arno A. Karner: "Re: [phplib] Returning an error message"
- Previous message: Peter Bowyer: "[phplib] Returning an error message"
- In reply to: Peter Bowyer: "[phplib] Returning an error message"
- Next in thread: Arno A. Karner: "Re: [phplib] Returning an error message"
- Reply: Arno A. Karner: "Re: [phplib] Returning an error message"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

