Re: SELECT statement

From: Date: Mon, 11 Dec 2000 21:11:00 +0000
Subject: Re: SELECT statement
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5161@lists.php.net to get a copy of this message
On Mon, 11 Dec 2000, Julio Cuz, Jr. wrote: > 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? use the "or die" option. do this: $result = [somedb]sql_query($sql) or die ("could not select..."); -lucas > Thanks a lot! > > > Julio Cuz, Jr. > Riverside Community College > jcuz@rccd.cc.ca.us ------------------------ Lucas Rockwell lr@socrates.berkeley.edu

« previous php.db (#5161) next »