Re: Re: What is my Mistake?

From: Date: Wed, 25 Jun 2014 00:12:49 +0000
Subject: Re: Re: What is my Mistake?
References: 1 2 3 4  Groups: php.db 
Request: Send a blank email to php-db+get-48888@lists.php.net to get a copy of this message
On 06/24/2014 01:55 PM, Jim Giner wrote:
Looking at your code again, I think that your query failed and your lack of error reporting isn't showing the error that occurred when you tried to access a property of the result which is not a resource but merely a value of 'false'. One should ALWAYS check the result of operations before assuming that they succeeded and proceeding onwards in code. Saves lots of lost time.
Jim - Thanks. Error checking as per your instructions. No errors. Attached are two files. I tried to mimic the behavior of the program. One file does the data input and the second processes it. The display on the browser screen is select Cust_Num, Lname, Fname from Customers where Phone = '845-123-3298' here2here3 result..... Last Name First Name When the above query is run from the command line - mysql> select Cust_Num, Lname, Fname from Customers where Phone = '845-123-3298'; +----------+--------+-------+ | Cust_Num | Lname | Fname | +----------+--------+-------+
|        1 | Kitten | Gingy |
|     1153 | Puppy  | Woofy |
|     1154 | Puppy  | Woofy |
+----------+--------+-------+ TIA Ethan

Attachment: [application/x-httpd-php] StartTestPh.php
Attachment: [application/x-httpd-php] TestPh.php
« previous php.db (#48888) next »