Re: SELECT statement
| From: | Julio Cuz, Jr. | Date: | Wed, 04 Apr 2001 22:53:55 +0000 |
| Subject: | Re: SELECT statement | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8221@lists.php.net to get a copy of this message | ||
Ron,
Thanks for your help, but my problem still there even when I made the following changes:
$sql = "SELECT * FROM \"Remodel\" WHERE Email=\"".$find."\"";
By the way, you're correct when saying that "WO" and "Email" are column names and '"$find" is what the user entered when searching for a record.
At 03:39 PM 4/4/2001 -0700, you wrote:
At 03:24 PM 4/4/2001 -0700, Julio Cuz, Jr. wrote:Julio Cuz, Jr. Riverside Community College jcuz@rccd.cc.ca.usEvery time I run the following code, I get this error if I use a NUMBER for the 'Email' case: "Warning: Unable to jump to row 0 on PostgreSQL result index 2 in /html/rccd/remodel/display2.php on line 35"The problem is that your query is equivalent to going: SELECT * FROM "Remodel" WHERE "WO" LIKE 1; // or some other numerical value The "WO" is a string because it is in quotes so you are saying: WHERE string = integer Ain't gonna happen so the result is always empty. What you want probably is (assuming WO is a column name): $sql = "SELECT * FROM \"Remodel\" WHERE WO=\"".$find."\""; It is equals since you are using an integer instead of a string (like is for strings).or, if I use a string (i.e. jcuz@rccd.cc.ca.us), I get this error message: "Warning: PostgreSQL query failed: ERROR: Attribute 'jcuz' not found in /html/rccd/remodel/display2.php on line 33"Same problem. "EMAIL" means the string "EMAIL" not the column called "EMAIL". Cheers, Ron -----------------------------------------------------------------------------Island Net AMT Solutions Group Inc. Telephone: 250 383-0096 1412 Quadra Toll Free: 1 800 331-3055 Victoria, B.C. Fax: 250 383-6698 V8W 2L1 E-Mail: support@islandnet.com Canada WWW: http://www.islandnet.com/-----------------------------------------------------------------------------