[PHP-DB] Re: What is my Mistake?

2014-06-24 Thread Jim Giner

Ethan -
You say your script stops here :  echo 'here3';  To be sure, you mean 
that the script DOES echo out 'here3' or does NOT get there?  I'm going 
to guess that it does get to that echo statement but the very next one 
is going to kill you because you cannot echo out a resource.


ONCE AGAIN - do you have php error checking turned on as you've been 
told many many times?


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: What is my Mistake?

2014-06-24 Thread Jim Giner

I don't recognize your error reporting configuration.  Try this instead:

error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors','1');


As for php startup errors, if you are not running your own installation, 
you don't need that.


So - if 'here3' is never echoed, then your code does NOT stop there - it 
obviously stopped somewhere prior to that.  Add more debugging lines to 
isolate exactly how far it gets.


(I assume that all of your other echos did appear?)

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: What is my Mistake?

2014-06-24 Thread Jim Giner
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.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: What is my Mistake?

2014-06-24 Thread Ethan Rosenberg, PhD

On 06/24/2014 08:12 PM, Ethan Rosenberg, PhD wrote:

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



Jim -

I think I know the problem.

These two lines of code were added -


$nmbr=mysqli_num_rows ( $result1 );
echo 'br 
/number of rows $nmbr';

The echo statement does not return a number.
Therefore ... bad connection. The script failed at the output stage 
because there were no results.


I'm again attaching the two files. They are somewhat modified.  The only 
thing in the first file is the form. The second file contains the 
calculations


TIA

Ethan



I have made the linnk $cxn a global variable in the in both scripts.
attachment: TestPh.php
attachment: StartTestPh2.php
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php