Page 1 of 1

mysql error

Posted: Thu Sep 20, 2007 9:06 am
by mad_phpq
i'm using adodb to connect to mysql.


tried this

Code: Select all

$sql = "INSERT INTO this that"
$query = $db->execute( $sql ) or die ( errorReport( $db->ErrorMsg(), __FILE__, __LINE__, $sql ) );
but it dies even if the sql is executed. Can anyone see why this is? I have a function called errorReport that will e-mail the results of the error.

--Mark

Posted: Thu Sep 20, 2007 9:09 am
by mad_phpq
ps the adodb inbuilt error reporting isnt good enough for what i need.

Posted: Thu Sep 20, 2007 9:30 am
by maliskoleather
your query looks wrong.

Code: Select all

INSERT INTO tablename(column1,column2,column3) VALUES value1,value2,value3
or
INSERT INTO tablename VALUES value1,value2,value3
the latter being if you intend on updating all columns in the table

you may wanna try a different format for your query...

Code: Select all

$query = $db->execute( $sql )
if(!$query) die($db->ErrorMsg());

Posted: Thu Sep 20, 2007 9:55 am
by mad_phpq
thanks. That first part i just typed out 'this that' in a hurry. :lol: My query is fine.

Thats bottom part looks the business. Thanks. :D