Hi:
How are you? I finally put together a couple of forms to enter data into a mysql dbase.
I'm just stuck on checking whether or not the data was accepted.
I do not know how and where to put mysql_errno or mysql_error, etc..
Are you able to help me on this one?
Thanks a bunch, Izzy
Here is a sample of how I do this..
if(!mysql_db_query($db,"INSERT INTO tablename VALUES ('$val1', '$val2', '$val3', '$val4')")): echo "TABLENAME INSERT ERROR:".mysql_errno().mysql_error()."\n"; endif;
if the query fails you get the error message
But what if the query is put in a variable. Like:
$myvariable = mysql_db_query(...);
how can you test if there was an error in this query. I tried this:
if (!$myvariable) $errormessage == "error";
but it didn't work. Anyone has a solution?
-Ilir.