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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.