Jump to content

PHP to mysql


wintercounter

Recommended Posts

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
Share on other sites

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