jammesz Posted July 23, 2007 Share Posted July 23, 2007 Does any one know how i can do multiple querys in AdoDB Lite? This is an example of what im trying to do: $sql="DROP TABLE IF EXISTS cms_users; CREATE TABLE cms_users ( usr_id INT( 255 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , usr_username VARCHAR( 255 ) NOT NULL , usr_password VARCHAR( 255 ) NOT NULL , UNIQUE ( usr_username ) ) ENGINE = innodb; "; $db->Execute($sql) or die("Error creating table"); But it doesnt work and comes up with an error. Btw the error msg doesnt give me any clues to what is wrong with it. It just says incorrect syntax. So i tried this: $sql="DROP TABLE IF EXISTS cms_users;"; $db->Execute($sql) or die("Error dropping existing tables"); $sql=" CREATE TABLE cms_users ( usr_id INT( 255 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , usr_username VARCHAR( 255 ) NOT NULL , usr_password VARCHAR( 255 ) NOT NULL , UNIQUE ( usr_username ) ) ENGINE = innodb; "; $db->Execute($sql) or die("Error creating table"); The above code works but i really dont want to do it this way. Quote Link to comment Share on other sites More sharing options...
trq Posted July 23, 2007 Share Posted July 23, 2007 Most php database interfaces do not allow multiple queries to be executed. In fact the only one I know of that does is mysqli. Quote Link to comment Share on other sites More sharing options...
jammesz Posted July 23, 2007 Author Share Posted July 23, 2007 kk. I guess im gonna have to put up with it. Anyway thanks for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.