wintercounter Posted July 7, 2007 Share Posted July 7, 2007 CREATE TABLE IF NOT EXISTS `".$this->ipsclass->DB->obj['sql_tbl_prefix']."ibspeak_messages` ( `id` bigint(20) NOT NULL auto_increment, `mid` mediumint( NOT NULL default '0', `date` int(10) NOT NULL default '0', `message` text NOT NULL, PRIMARY KEY (`id`) ) ;"; } if($this->alterTables) { $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_usesystem` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_canview` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_canshout` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_caneditown` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_canedit` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_candeleteown` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_candelete` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_canviewhistory` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_postsmilies` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_postbbcode` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_posthtml` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_noflood` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."members` ADD `ibspeak_isbanned` tinyint(1) NOT NULL default '0'"; $q[] = "ALTER TABLE `".$this->ipsclass->DB->obj['sql_tbl_prefix']."groups` ADD `g_ibspeak_canban` tinyint(1) NOT NULL default '0'"; } return $q; Hi! Can anyone translate me this php script to mysql script, that i can import into my database. The prefix is: ibf Thank you very much! Link to comment https://forums.phpfreaks.com/topic/58835-php-to-mysql/ Share on other sites More sharing options...
wildteen88 Posted July 7, 2007 Share Posted July 7, 2007 Just replace `".$this->ipsclass->DB->obj['sql_tbl_prefix']." with ibf_ then just copy the strings defined within double quotes (for example: $q[] = "COPY WHAT IS HERE"; ). Basically just drop everything that is PHP related when you have done that you're left with the SQL query which should be ready to be queried into MySQL. There you go: CREATE TABLE IF NOT EXISTS `ibf_ibspeak_messages` ( `id` bigint(20) NOT NULL auto_increment, `mid` mediumint( NOT NULL default '0', `date` int(10) NOT NULL default '0', `message` text NOT NULL, PRIMARY KEY (`id`) ); ALTER TABLE `ibf_groups` ADD `g_ibspeak_usesystem` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_canview` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_canshout` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_caneditown` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_canedit` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_candeleteown` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_candelete` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_canviewhistory` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_postsmilies` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_postbbcode` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_posthtml` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_noflood` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_members` ADD `ibspeak_isbanned` tinyint(1) NOT NULL default '0'; ALTER TABLE `ibf_groups` ADD `g_ibspeak_canban` tinyint(1) NOT NULL default '0'; Link to comment https://forums.phpfreaks.com/topic/58835-php-to-mysql/#findComment-291920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.