[UPHPU] db.php

Walt Haas haas at xmission.com
Sat May 6 20:20:17 MDT 2006


Gill Bates <unixgeek at zoelife4u.org> wrote:

> i see that the file didn't attach to my email so I'll have to paste it 
> here, sorry y'all:
...
>     function insertRecord ($fieldarray) {
...
>         $result = @mysql_query($SQL, $dbconnect);

This is not the normal way to call mysql_query()  The effect of the @
before the call is to throw away the return, so you would not expect
$result to be set correctly.  If you take away the @ then you can test
$result for the value false to see whether the call failed.

>     function updateRecord ($fieldarray) {
...
>         $result = mysql_query($SQL, $dbconnect) or trigger_error("SQL", 
> E_USER_ERROR);

This is not the normal way to evaluate the return either.
Try:
  $result = mysql_query($SQL, $dbconnect)
  if (!$result) {
      trigger_error("SQL", 
  }
-------
Walt Haas          The Web Site Doctor - Cures Sick Web Sites
(801) 534-1262     http://thewebsitedoctor.net


More information about the UPHPU mailing list