Page 1 of 1

alternative error messages

Posted: Tue Jan 17, 2006 12:11 am
by spitfire_esquive

Code: Select all

$result=mysql_query($pasok);

if ($result) {
      echo mysql_affected_rows().' Recorded.';
    }
    else{
      echo "Record not saved.";
      exit;
    }
hello i have the above code. can you guys suggest a function/command that would give me a specific error if the record is "Record not saved". it is from a web database application that i'm trying to develop and sometimes the "Record not saved" error comes out. presently i am looking to see if it has anything to do with how my mysql database is structured.

thanks in advance! :D

Posted: Tue Jan 17, 2006 2:33 am
by Christopher
mysql_errno -- Returns the numerical value of the error message from previous MySQL operation
mysql_error -- Returns the text of the error message from previous MySQL operation

http://www.php.net/manual/en/ref.mysql.php

Re: alternative error messages

Posted: Tue Jan 17, 2006 3:33 am
by Jenk
spitfire_esquive wrote:

Code: Select all

$result=mysql_query($pasok);

if ($result) {
      echo mysql_affected_rows($result).' Recorded.';
    }
    else{
      echo "Record not saved.";
      exit;
    }
fixed..