mysql error

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mad_phpq
Forum Commoner
Posts: 85
Joined: Fri Apr 27, 2007 5:53 am

mysql error

Post 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
mad_phpq
Forum Commoner
Posts: 85
Joined: Fri Apr 27, 2007 5:53 am

Post by mad_phpq »

ps the adodb inbuilt error reporting isnt good enough for what i need.
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post 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());
mad_phpq
Forum Commoner
Posts: 85
Joined: Fri Apr 27, 2007 5:53 am

Post 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
Post Reply