Skip to content

Instantly share code, notes, and snippets.

@vanilla-thunder
Last active December 17, 2015 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanilla-thunder/5539449 to your computer and use it in GitHub Desktop.
Save vanilla-thunder/5539449 to your computer and use it in GitHub Desktop.
[OXID eShop] check if a table column exists, e.g. for module activatin / deactivation events
$oDb = oxDb::getDb();
$oRs = $oDb->metaColumnNames("tablename");
// check for lower case and upper case column name
if (!array_key_exists("columnname", $oRs) && !array_key_exists("COLUMNNAME", $oRs)) {
{
// column does not exists
// do something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment