Re: SELECT statement

From: Date: Mon, 11 Dec 2000 21:07:09 +0000
Subject: Re: SELECT statement
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5160@lists.php.net to get a copy of this message
Hi, if $number doesn't exist you just get an empty result. So displaying an error-msg could go by this $empty = mysql_num_rows($sql); if ($empty == 0) { ERROR; } For the second you could play with what PHP gives you to determine types. Sorry no closer idea. J ""Julio Cuz, Jr."" <jcuz@rccd.cc.ca.us> schrieb im Newsbeitrag news:4.3.2.7.2.20001211125715.00b339d0@rccd.cc.ca.us... > Hi-- > > Let's say I'm doing this: > > $sql = "SELECT * FROM Facilities WHERE WO=$number"; > > What if "$number" doesn't exist OR is NOT an integer for example, how can I > trap that error and display a message? Or other idea? > > Thanks a lot! > > > Julio Cuz, Jr. > Riverside Community College > jcuz@rccd.cc.ca.us

« previous php.db (#5160) next »