Jump to content

is my sql statement wrong


purencool

Recommended Posts

hi phpfreaks

 

I have been looking at this code below and it has got me :confused:. Can someone check it for me. The issue is it installs some tables into an application and then adds some data. The but the  I keep getting the error below

 

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.

 

The code last line of code is the one it is complaining about

                $db->exec("INSERT INTO Customer
                            (Username,Passwd,Email,Phone) VALUES 
                            ('".$this->usernameadmin."',
                             '".$this->passwordadmin."',
                             '".$this->emailadmin."',
                             '".$this->phoneadmin."')");

attached is complete method this is driving me nuts any help would be appreciated.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/224260-is-my-sql-statement-wrong/
Share on other sites

No, that's not the problem. It seems like you're trying to execute two queries at once, by the looks of the error. Maybe you want to commit the transaction for creating tables before doing the insert? Sorry I can't be of more help, but atleast it should help you know that it's not the query itself

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.