ezakimak Posted June 13, 2011 Share Posted June 13, 2011 hi,Is there a way to get the sqlcode error code returned by the server after a sql is executed agains it.In my case I need to know if a certain column was already added to a table, for example this code: // Add nacionality field to customer table $query = 'ALTER TABLE `' ._DB_PREFIX_.'customer` ADD `nationality` int(10) unsigned NULL default 0'; $result=Db::getInstance()->Execute ($query); in this case the Db class returns false if the sql fails, but I cannot guarantee that it failed because the column already exists, it could be false maybe because the user has not rights over that table.This would be useful to display the correct error message to the user who is trying to install this module for instance.thanks for your helpregardsHugo Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now