Page 1 of 1

Hello Please any can solved my problem

Posted: Sat Mar 15, 2014 10:23 pm
by netflixmedia
syntax error, unexpected '"InnoDB"' (T_CONSTANT_ENCAPSED_STRING) online 49

Code: Select all

<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

include( "config.inc.php" );
( 1 );
if ( !isset( $_COOKIE['inout_admin'] ) )
{
    ( "Location:index.php" );
    exit( 0 );
}
$inout_username = $_COOKIE['inout_admin'];
$inout_password = $_COOKIE['inout_pass'];
if ( !( $inout_username == ( $username ) && $inout_password == ( $password ) ) )
{
    ( "Location:index.php" );
    exit( 0 );
}
( 0 );
include( "pre-check.php" );
$covert_non_safe_data = 0;
$fresh = 1;
$tables = ( $mysql_dbname );
while ( list( $temp ) = temp )
{
    if ( !( $temp == "ppc_settings" ) )
    {
        continue;
    }
    $fresh = 0;
    break;
    break;
}
if ( $fresh == 0 )
{
    $innodb_conversion = 1;
    $tab = ( "SHOW TABLE STATUS " );
    while ( $tab1 = ( $tab ) )
    {
        if ( $tab1[0] == "view_keywords" || $tab1[0] == "ppc_impressions" || $tab1[0] == "ppc_daily_impressions" )
        {
            continue;
        }
        if ( !( ( $tab1['Engine'] "InnoDB" ) != 0 ) && ( "alter table {$tab1['0']} ENGINE='InnoDB'" ) )
        {
            $innodb_conversion = 0;
        }
    }
    if ( $innodb_conversion == 0 )
    {
        echo "\t\t\t\t  <div class=\"already\">InnoDB conversion failed. We cannot proceed with installation. Please try refreshing this page.  </div>\r\n\t\t\t";
        exit( );
    }
}
$charset_collation = " ";
if ( $fresh == 1 )
{
    ( "set names utf8 collate utf8_unicode_ci" );
    $charset_collation = " collate utf8_unicode_ci ";
}
else if ( $table_fields_collation != "" )
{
    $charset_collation = " collate {$table_fields_collation} ";
}
else
{
    $covert_non_safe_data = 1;
    $tablefields = ( "SHOW FULL COLUMNS FROM ppc_ads where collation is not null" );
    if ( !( $tablefield = ( $tablefields ) ) )
    {
        break;
    }
    ( "INSERT INTO `ppc_settings` VALUES ('0', 'ppc', 'table_fields_collation', '{$tablefield['Collation']}');" );
    $charset_collation = " collate {$tablefield['Collation']} ";
    if ( ( $tablefield['Collation'], "utf8_unicode_ci" ) == 0 )
    {
        ( "set names utf8 collate utf8_unicode_ci" );
    }
    break;
}
( "CREATE TABLE IF NOT EXISTS `ppc_keywords` (\r\n  `id` int(11) NOT NULL auto_increment,\r\n  `aid` int(11) NOT NULL default '0',\r\n  `uid` int(11) NOT NULL default '0',\r\n  `keyword` varchar(255) NOT NULL default '',\r\n  `maxcv` float NOT NULL default '0',\r\n  `status` int(11) NOT NULL default '0',\r\n  `time` int(11) NOT NULL default '0',\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
$weightageflag = 0;
$systemid = 0;
$tblcolums = ( "SHOW COLUMNS FROM `ppc_keywords`" );
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "weightage" )
    {
        $weightageflag = 1;
    }
    if ( $row['Field'] == "sid" )
    {
        $systemid = 1;
    }
}
if ( $weightageflag == 0 )
{
    ( "ALTER TABLE `ppc_keywords` ADD `weightage` FLOAT NOT NULL default '0';" );
    ( "UPDATE `ppc_keywords` SET `weightage`=`maxcv`;" );
    echo ( );
}
if ( $systemid == 0 )
{
    ( "ALTER TABLE `ppc_keywords` ADD `sid` int(11) NOT NULL default '0';" );
    echo ( );
}
( "CREATE TABLE IF NOT EXISTS `ppc_settings` (  `id` int(11) NOT NULL auto_increment,\r\n  `section` varchar(50) NOT NULL default '',\r\n  `name` varchar(50) NOT NULL default '',\r\n  `value` longtext NOT NULL,\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
( "CREATE TABLE IF NOT EXISTS `ppc_publishers` (\r\n  `uid` int(11) NOT NULL auto_increment,\r\n  `username` varchar(255) NOT NULL default '',\r\n  `password` varchar(255) NOT NULL default '',\r\n  `email` varchar(255) NOT NULL default '',\r\n  `status` int(11) NOT NULL default '0',\r\n  `country` varchar(50) NOT NULL default '',\r\n  `do".__FILE__."` varchar(255) NOT NULL default '',\r\n  `regtime` int(11) default NULL,\r\n  `lastlogin` int(11) default NULL,\r\n  `accountbalance` float NOT NULL default '0',\r\n  `xmlstatus` int(11) NOT NULL default '0',\r\n  `lastloginip` varchar(255) NOT NULL,\r\n   PRIMARY KEY  (`uid`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
$usr_ridflag = 0;
$usr_warning_statusflag = 0;
$usr_traffic_analysis = 0;
$firstname_flag = 0;
$lastname_flag = 0;
$phone_no_flag = 0;
$address_flag = 0;
$common_account_id1 = 0;
$parent_status1 = 0;
$server_id_flag = 0;
$captcha_status = 0;
$captcha_time = 0;
$taxidentification = 0;
$premiumst = 0;
$tblcolums = ( "SHOW COLUMNS FROM ppc_publishers" );
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "rid" )
    {
        $usr_ridflag = 1;
    }
    if ( $row['Field'] == "warning_status" )
    {
        $usr_warning_statusflag = 1;
    }
    if ( $row['Field'] == "traffic_analysis" )
    {
        $usr_traffic_analysis = 1;
    }
    if ( $row['Field'] == "phone_no" )
    {
        $phone_no_flag = 1;
        if ( $row['Type'] == "int(11)" )
        {
            ( "ALTER TABLE `ppc_publishers` MODIFY `phone_no` BIGINT NOT NULL DEFAULT '0';" );
        }
    }
    if ( $row['Field'] == "firstname" )
    {
        $firstname_flag = 1;
    }
    if ( $row['Field'] == "lastname" )
    {
        $lastname_flag = 1;
    }
    if ( $row['Field'] == "address" )
    {
        $address_flag = 1;
    }
    if ( $row['Field'] == "override_encoding" )
    {
        ( "ALTER TABLE `ppc_publishers` CHANGE `override_encoding` `xmlstatus` INT( 11 ) NOT NULL DEFAULT '0'" );
    }
    if ( $row['Field'] == "common_account_id" )
    {
        $common_account_id1 = 1;
    }
    if ( $row['Field'] == "parent_status" )
    {
        $parent_status1 = 1;
    }
    if ( $row['Field'] == "server_id" )
    {
        $server_id_flag = 1;
    }
    if ( $row['Field'] == "captcha_status" )
    {
        $captcha_status = 1;
    }
    if ( $row['Field'] == "captcha_time" )
    {
        $captcha_time = 1;
    }
    if ( $row['Field'] == "taxidentification" )
    {
        $taxidentification = 1;
    }
    if ( $row['Field'] == "premium_status" )
    {
        $premiumst = 1;
    }
}
if ( $usr_ridflag == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `rid` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $usr_warning_statusflag == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `warning_status` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $usr_traffic_analysis == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `traffic_analysis` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $firstname_flag == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `firstname` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $lastname_flag == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `lastname` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $phone_no_flag == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `phone_no` BIGINT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $address_flag == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `address` LONGTEXT {$charset_collation} ;" );
    echo ( );
}
if ( $common_account_id1 == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `common_account_id` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $parent_status1 == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `parent_status` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $server_id_flag == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `server_id` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $captcha_status == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `captcha_status` INT not null default 0;" );
    echo ( );
}
if ( $captcha_time == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `captcha_time` INT not null default 0;" );
    echo ( );
}
if ( $taxidentification == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `taxidentification` varchar(255) not null default '';" );
    echo ( );
}
if ( $premiumst == 0 )
{
    ( "ALTER TABLE `ppc_publishers` ADD `premium_status` int not null default 0;" );
    echo ( );
}
( "CREATE TABLE IF NOT EXISTS `ppc_users` (\r\n  `uid` int(11) NOT NULL auto_increment,\r\n  `username` varchar(255) NOT NULL default '',\r\n  `password` varchar(255) NOT NULL default '',\r\n  `email` varchar(255) NOT NULL default '',\r\n  `status` int(11) NOT NULL default '0',\r\n  `country` VARCHAR(2) default NULL,\r\n  `do".__FILE__."` varchar(255) default NULL,\r\n  `regtime` int(11) default NULL,\r\n  `lastlogin` int(11) default NULL,\r\n  `accountbalance` float NOT NULL default '0',\r\n  PRIMARY KEY  (`uid`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
$usr_ridflag = 0;
$usr_bonusbalanceflag = 0;
$firstname_flag = 0;
$lastname_flag = 0;
$phone_no_flag = 0;
$address_flag = 0;
$balancestatus_flag = 0;
$common_account_id = 0;
$parent_status = 0;
$taxidentification = 0;
$tblcolums = ( "SHOW COLUMNS FROM `ppc_users`" );
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "rid" )
    {
        $usr_ridflag = 1;
    }
    if ( $row['Field'] == "bonusbalance" )
    {
        $usr_bonusbalanceflag = 1;
    }
    if ( $row['Field'] == "phone_no" )
    {
        $phone_no_flag = 1;
        if ( $row['Type'] == "int(11)" )
        {
            ( "ALTER TABLE `ppc_users` MODIFY `phone_no` BIGINT NOT NULL DEFAULT '0';" );
        }
    }
    if ( $row['Field'] == "firstname" )
    {
        $firstname_flag = 1;
    }
    if ( $row['Field'] == "lastname" )
    {
        $lastname_flag = 1;
    }
    if ( $row['Field'] == "address" )
    {
        $address_flag = 1;
    }
    if ( $row['Field'] == "common_account_id" )
    {
        $common_account_id = 1;
    }
    if ( $row['Field'] == "balancestatus" )
    {
        $balancestatus_flag = 1;
    }
    if ( $row['Field'] == "parent_status" )
    {
        $parent_status = 1;
    }
    if ( $row['Field'] == "taxidentification" )
    {
        $taxidentification = 1;
    }
}
if ( $usr_ridflag == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `rid` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $usr_bonusbalanceflag == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `bonusbalance` FLOAT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $firstname_flag == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `firstname` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $lastname_flag == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `lastname` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $phone_no_flag == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `phone_no` BIGINT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $address_flag == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `address` LONGTEXT {$charset_collation} ;" );
    echo ( );
}
if ( $balancestatus_flag == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `balancestatus` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $common_account_id == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `common_account_id` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $parent_status == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `parent_status` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
if ( $taxidentification == 0 )
{
    ( "ALTER TABLE `ppc_users` ADD `taxidentification` varchar(255) NOT NULL DEFAULT '';" );
    echo ( );
}
$table = "location_country";
$flag_credittext_bordercolor = 0;
$flag_location_country = 0;
$flag_publisher_credit = 0;
$flag_ppc_banner_sizes = 0;
$flag_ppc_ad_block = 0;
$flag_email_templates = 0;
$flag_site_content = 0;
$flag_terms = 0;
$tables = ( $mysql_dbname );
while ( list( $temp ) = temp )
{
    if ( $temp == $table )
    {
        $flag_location_country = 1;
    }
    if ( $temp == "ppc_publisher_credits" )
    {
        $flag_publisher_credit = 1;
    }
    if ( $temp == "ppc_credittext_bordercolor" )
    {
        $flag_credittext_bordercolor = 1;
    }
    if ( $temp == "ppc_banner_sizes" )
    {
        $flag_ppc_banner_sizes = 1;
    }
    if ( $temp == "ppc_ad_block" )
    {
        $flag_ppc_ad_block = 1;
    }
    if ( $temp == "email_templates" )
    {
        $flag_email_templates = 1;
    }
    if ( $temp == "site_content" )
    {
        $flag_site_content = 1;
    }
    if ( $temp == "terms_and_conditions" )
    {
        $flag_terms = 1;
    }
}
if ( $flag_location_country == 0 )
{
    ( "CREATE TABLE IF NOT EXISTS `location_country` (\r\n\t  `code` varchar(2) NOT NULL default '',\r\n\t  `name` varchar(255)  NOT NULL default '',\r\n\t  PRIMARY KEY  (`code`)\r\n\t) ENGINE=InnoDB {$charset_collation} ;" );
    ( "INSERT INTO `location_country` (`code`, `name`) VALUES\r\n\t('A1', 'Anonymous Proxy'),\r\n\t('A2', 'Satellite Provider'),\r\n\t('AD', 'Andorra'),\r\n\t('AE', 'United Arab Emirates'),\r\n\t('AF', 'Afghanistan'),\r\n\t('AG', 'Antigua and Barbuda'),\r\n\t('AI', 'Anguilla'),\r\n\t('AL', 'Albania'),\r\n\t('AM', 'Armenia'),\r\n\t('AN', 'Netherlands Antilles'),\r\n\t('AO', 'Angola'),\r\n\t('AP', 'Asia/Pacific Region'),\r\n\t('AQ', 'Antarctica'),\r\n\t('AR', 'Argentina'),\r\n\t('AS', 'American Samoa'),\r\n\t('AT', 'Austria'),\r\n\t('AU', 'Australia'),\r\n\t('AW', 'Aruba'),\r\n\t('AX', 'Aland Islands'),\r\n\t('AZ', 'Azerbaijan'),\r\n\t('BA', 'Bosnia and Herzegovina'),\r\n\t('BB', 'Barbados'),\r\n\t('BD', 'Bangladesh'),\r\n\t('BE', 'Belgium'),\r\n\t('BF', 'Burkina Faso'),\r\n\t('BG', 'Bulgaria'),\r\n\t('BH', 'Bahrain'),\r\n\t('BI', 'Burundi'),\r\n\t('BJ', 'Benin'),\r\n\t('BM', 'Bermuda'),\r\n\t('BN', 'Brunei Darussalam'),\r\n\t('BO', 'Bolivia'),\r\n\t('BR', 'Brazil'),\r\n\t('BS', 'Bahamas'),\r\n\t('BT', 'Bhutan'),\r\n\t('BV', 'Bouvet Island'),\r\n\t('BW', 'Botswana'),\r\n\t('BY', 'Belarus'),\r\n\t('BZ', 'Belize'),\r\n\t('CA', 'Canada'),\r\n\t('CC', 'Cocos (Keeling) Islands'),\r\n\t('CD', 'Congo, The Democratic Republic of the'),\r\n\t('CF', 'Central African Republic'),\r\n\t('CG', 'Congo'),\r\n\t('CH', 'Switzerland'),\r\n\t('CI', 'Cote d''Ivoire'),\r\n\t('CK', 'Cook Islands'),\r\n\t('CL', 'Chile'),\r\n\t('CM', 'Cameroon'),\r\n\t('CN', 'China'),\r\n\t('CO', 'Colombia'),\r\n\t('CR', 'Costa Rica'),\r\n\t('CU', 'Cuba'),\r\n\t('CV', 'Cape Verde'),\r\n\t('CX', 'Christmas Island'),\r\n\t('CY', 'Cyprus'),\r\n\t('CZ', 'Czech Republic'),\r\n\t('DE', 'Germany'),\r\n\t('DJ', 'Djibouti'),\r\n\t('DK', 'Denmark'),\r\n\t('DM', 'Dominica'),\r\n\t('DO', 'Dominican Republic'),\r\n\t('DZ', 'Algeria'),\r\n\t('EC', 'Ecuador'),\r\n\t('EE', 'Estonia'),\r\n\t('EG', 'Egypt'),\r\n\t('EH', 'Western Sahara'),\r\n\t('ER', 'Eritrea'),\r\n\t('ES', 'Spain'),\r\n\t('ET', 'Ethiopia'),\r\n\t('EU', 'Europe'),\r\n\t('FI', 'Finland'),\r\n\t('FJ', 'Fiji'),\r\n\t('FK', 'Falkland Islands (Malvinas)'),\r\n\t('FM', 'Micronesia, Federated States of'),\r\n\t('FO', 'Faroe Islands'),\r\n\t('FR', 'France'),\r\n\t('GA', 'Gabon'),\r\n\t('GB', 'United Kingdom'),\r\n\t('GD', 'Grenada'),\r\n\t('GE', 'Georgia'),\r\n\t('GF', 'French Guiana'),\r\n\t('GG', 'Guernsey'),\r\n\t('GH', 'Ghana'),\r\n\t('GI', 'Gibraltar'),\r\n\t('GL', 'Greenland'),\r\n\t('GM', 'Gambia'),\r\n\t('GN', 'Guinea'),\r\n\t('GP', 'Guadeloupe'),\r\n\t('GQ', 'Equatorial Guinea'),\r\n\t('GR', 'Greece'),\r\n\t('GS', 'South Georgia and the South Sandwich Islands'),\r\n\t('GT', 'Guatemala'),\r\n\t('GU', 'Guam'),\r\n\t('GW', 'Guinea-Bissau'),\r\n\t('GY', 'Guyana'),\r\n\t('HK', 'Hong Kong'),\r\n\t('HM', 'Heard Island and McDonald Islands'),\r\n\t('HN', 'Honduras'),\r\n\t('HR', 'Croatia'),\r\n\t('HT', 'Haiti'),\r\n\t('HU', 'Hungary'),\r\n\t('ID', 'Indonesia'),\r\n\t('IE', 'Ireland'),\r\n\t('IL', 'Israel'),\r\n\t('IM', 'Isle of Man'),\r\n\t('IN', 'India'),\r\n\t('IO', 'British Indian Ocean Territory'),\r\n\t('IQ', 'Iraq'),\r\n\t('IR', 'Iran, Islamic Republic of'),\r\n\t('IS', 'Iceland'),\r\n\t('IT', 'Italy'),\r\n\t('JE', 'Jersey'),\r\n\t('JM', 'Jamaica'),\r\n\t('JO', 'Jordan'),\r\n\t('JP', 'Japan'),\r\n\t('KE', 'Kenya'),\r\n\t('KG', 'Kyrgyzstan'),\r\n\t('KH', 'Cambodia'),\r\n\t('KI', 'Kiribati'),\r\n\t('KM', 'Comoros'),\r\n\t('KN', 'Saint Kitts and Nevis'),\r\n\t('KP', 'Korea, Democratic People''s Republic of'),\r\n\t('KR', 'Korea, Republic of'),\r\n\t('KW', 'Kuwait'),\r\n\t('KY', 'Cayman Islands'),\r\n\t('KZ', 'Kazakhstan'),\r\n\t('LA', 'Lao People''s Democratic Republic'),\r\n\t('LB', 'Lebanon'),\r\n\t('LC', 'Saint Lucia'),\r\n\t('LI', 'Liechtenstein'),\r\n\t('LK', 'Sri Lanka'),\r\n\t('LR', 'Liberia'),\r\n\t('LS', 'Lesotho'),\r\n\t('LT', 'Lithuania'),\r\n\t('LU', 'Luxembourg'),\r\n\t('LV', 'Latvia'),\r\n\t('LY', 'Libyan Arab Jamahiriya'),\r\n\t('MA', 'Morocco'),\r\n\t('MC', 'Monaco'),\r\n\t('MD', 'Moldova, Republic of'),\r\n\t('ME', 'Montenegro'),\r\n\t('MG', 'Madagascar'),\r\n\t('MH', 'Marshall Islands'),\r\n\t('MK', 'Macedonia'),\r\n\t('ML', 'Mali'),\r\n\t('MM', 'Myanmar'),\r\n\t('MN', 'Mongolia'),\r\n\t('MO', 'Macao'),\r\n\t('MP', 'Northern Mariana Islands'),\r\n\t('MQ', 'Martinique'),\r\n\t('MR', 'Mauritania'),\r\n\t('MS', 'Montserrat'),\r\n\t('MT', 'Malta'),\r\n\t('MU', 'Mauritius'),\r\n\t('MV', 'Maldives'),\r\n\t('MW', 'Malawi'),\r\n\t('MX', 'Mexico'),\r\n\t('MY', 'Malaysia'),\r\n\t('MZ', 'Mozambique'),\r\n\t('NA', 'Namibia'),\r\n\t('NC', 'New Caledonia'),\r\n\t('NE', 'Niger'),\r\n\t('NF', 'Norfolk Island'),\r\n\t('NG', 'Nigeria'),\r\n\t('NI', 'Nicaragua'),\r\n\t('NL', 'Netherlands'),\r\n\t('NO', 'Norway'),\r\n\t('NP', 'Nepal'),\r\n\t('NR', 'Nauru'),\r\n\t('NU', 'Niue'),\r\n\t('NZ', 'New Zealand'),\r\n\t('OM', 'Oman'),\r\n\t('PA', 'Panama'),\r\n\t('PE', 'Peru'),\r\n\t('PF', 'French Polynesia'),\r\n\t('PG', 'Papua New Guinea'),\r\n\t('PH', 'Philippines'),\r\n\t('PK', 'Pakistan'),\r\n\t('PL', 'Poland'),\r\n\t('PM', 'Saint Pierre and Miquelon'),\r\n\t('PN', 'Pitcairn'),\r\n\t('PR', 'Puerto Rico'),\r\n\t('PS', 'Palestinian Territory'),\r\n\t('PT', 'Portugal'),\r\n\t('PW', 'Palau'),\r\n\t('PY', 'Paraguay'),\r\n\t('QA', 'Qatar'),\r\n\t('RE', 'Reunion'),\r\n\t('RO', 'Romania'),\r\n\t('RS', 'Serbia'),\r\n\t('RU', 'Russian Federation'),\r\n\t('RW', 'Rwanda'),\r\n\t('SA', 'Saudi Arabia'),\r\n\t('SB', 'Solomon Islands'),\r\n\t('SC', 'Seychelles'),\r\n\t('SD', 'Sudan'),\r\n\t('SE', 'Sweden'),\r\n\t('SG', 'Singapore'),\r\n\t('SH', 'Saint Helena'),\r\n\t('SI', 'Slovenia'),\r\n\t('SJ', 'Svalbard and Jan Mayen'),\r\n\t('SK', 'Slovakia'),\r\n\t('SL', 'Sierra Leone'),\r\n\t('SM', 'San Marino'),\r\n\t('SN', 'Senegal'),\r\n\t('SO', 'Somalia'),\r\n\t('SR', 'Suriname'),\r\n\t('ST', 'Sao Tome and Principe'),\r\n\t('SV', 'El Salvador'),\r\n\t('SY', 'Syrian Arab Republic'),\r\n\t('SZ', 'Swaziland'),\r\n\t('TC', 'Turks and Caicos Islands'),\r\n\t('TD', 'Chad'),\r\n\t('TF', 'French Southern Territories'),\r\n\t('TG', 'Togo'),\r\n\t('TH', 'Thailand'),\r\n\t('TJ', 'Tajikistan'),\r\n\t('TK', 'Tokelau'),\r\n\t('TL', 'Timor-Leste'),\r\n\t('TM', 'Turkmenistan'),\r\n\t('TN', 'Tunisia'),\r\n\t('TO', 'Tonga'),\r\n\t('TR', 'Turkey'),\r\n\t('TT', 'Trinidad and Tobago'),\r\n\t('TV', 'Tuvalu'),\r\n\t('TW', 'Taiwan'),\r\n\t('TZ', 'Tanzania, United Republic of'),\r\n\t('UA', 'Ukraine'),\r\n\t('UG', 'Uganda'),\r\n\t('UM', 'United States Minor Outlying Islands'),\r\n\t('US', 'United States'),\r\n\t('UY', 'Uruguay'),\r\n\t('UZ', 'Uzbekistan'),\r\n\t('VA', 'Holy See (Vatican City State)'),\r\n\t('VC', 'Saint Vincent and the Grenadines'),\r\n\t('VE', 'Venezuela'),\r\n\t('VG', 'Virgin Islands, British'),\r\n\t('VI', 'Virgin Islands, U.S.'),\r\n\t('VN', 'Vietnam'),\r\n\t('VU', 'Vanuatu'),\r\n\t('WF', 'Wallis and Futuna'),\r\n\t('WS', 'Samoa'),\r\n\t('YE', 'Yemen'),\r\n\t('YT', 'Mayotte'),\r\n\t('ZA', 'South Africa'),\r\n\t('ZM', 'Zambia'),\r\n\t('ZW', 'Zimbabwe') ;" );
    echo ( );
}
( "CREATE TABLE IF NOT EXISTS `ppc_clicks` (\r\n  `id` int(11) NOT NULL auto_increment,\r\n  `uid` int(11) NOT NULL default '0',\r\n  `aid` int(11) NOT NULL default '0',\r\n  `kid` int(11) NOT NULL default '0',\r\n  `clickvalue` float NOT NULL default '0',\r\n  `ip` varchar(255) NOT NULL default '',\r\n  `time` int(11) NOT NULL default '0',\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
$pidflag = 0;
$publisher_profit_flag = 0;
$clk_rid_flag = 0;
$pub_ref_profit_flag = 0;
$clk_adv_rid_flag = 0;
$adv_ref_profit_flag = 0;
$bidflag = 0;
$vidflag = 0;
$countryflag = 0;
$ctime = 0;
$tblcolums = ( "SHOW COLUMNS FROM `ppc_clicks`" );
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "pid" )
    {
        $pidflag = 1;
    }
    if ( $row['Field'] == "publisher_profit" )
    {
        $publisher_profit_flag = 1;
    }
    if ( $row['Field'] == "pub_rid" )
    {
        $clk_rid_flag = 1;
    }
    if ( $row['Field'] == "pub_ref_profit" )
    {
        $pub_ref_profit_flag = 1;
    }
    if ( $row['Field'] == "adv_rid" )
    {
        $clk_adv_rid_flag = 1;
    }
    if ( $row['Field'] == "adv_ref_profit" )
    {
        $adv_ref_profit_flag = 1;
    }
    if ( $row['Field'] == "bid" )
    {
        $bidflag = 1;
    }
    if ( $row['Field'] == "vid" )
    {
        $vidflag = 1;
    }
    if ( $row['Field'] == "country" )
    {
        $countryflag = 1;
    }
    if ( $row['Field'] == "current_time" )
    {
        $ctime = 1;
    }
}
if ( $pidflag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `pid` INT DEFAULT '0' NOT NULL;" );
    echo ( );
}
if ( $publisher_profit_flag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `publisher_profit` FLOAT DEFAULT '0.0' NOT NULL;" );
    echo ( );
}
if ( $clk_rid_flag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `pub_rid` INT DEFAULT '0' NOT NULL;" );
    echo ( );
}
if ( $pub_ref_profit_flag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `pub_ref_profit` FLOAT DEFAULT '0.0' NOT NULL;" );
    echo ( );
}
if ( $clk_adv_rid_flag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `adv_rid` INT DEFAULT '0' NOT NULL;" );
    echo ( );
}
if ( $adv_ref_profit_flag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `adv_ref_profit` FLOAT DEFAULT '0.0' NOT NULL;" );
    echo ( );
}
if ( $bidflag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `bid` INT DEFAULT '0' NOT NULL;" );
    echo ( );
}
if ( $vidflag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `vid` INT DEFAULT '0' NOT NULL;" );
    echo ( );
}
if ( $countryflag == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `country`  VARCHAR( 2 ) NOT NULL default '' " );
    echo ( );
}
if ( $ctime == 0 )
{
    ( "ALTER TABLE `ppc_clicks` ADD `current_time`  int( 11 ) NOT NULL default '0' " );
    echo ( );
}
( "CREATE TABLE IF NOT EXISTS `ppc_ads` (\r\n  `id` int(11) NOT NULL auto_increment,\r\n  `uid` int(11) NOT NULL default '0',\r\n  `link` longtext NOT NULL,\r\n  `title` varchar(255) default NULL,\r\n  `summary` longtext NOT NULL,\r\n  `maxamount` float NOT NULL default '0',\r\n  `amountused` float NOT NULL default '0',\r\n  `createtime` int(11) NOT NULL default '0',\r\n  `status` int(11) NOT NULL default '0',\r\n  `bannersize` int(11) default NULL,\r\n  `adtype` int(11) NOT NULL default '0',\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
$pausestatus = 0;
$displayurlflag = 0;
$updatedtimeflag = 0;
$wapstatusflag = 0;
$adlanguage = 0;
$adname = 0;
$tblcolums = ( "SHOW COLUMNS FROM `ppc_ads`" );
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "displayurl" )
    {
        $displayurlflag = 1;
    }
    if ( $row['Field'] == "updatedtime" )
    {
        $updatedtimeflag = 1;
    }
    if ( $row['Field'] == "pausestatus" )
    {
        $pausestatus = 1;
    }
    if ( $row['Field'] == "wapstatus" )
    {
        $wapstatusflag = 1;
    }
    if ( $row['Field'] == "adlang" )
    {
        $adlanguage = 1;
    }
    if ( $row['Field'] == "name" )
    {
        $adname = 1;
    }
}
if ( $displayurlflag == 0 )
{
    ( "ALTER TABLE `ppc_ads` ADD `displayurl` LONGTEXT {$charset_collation} ;" );
    echo ( );
}
if ( $updatedtimeflag == 0 )
{
    ( "ALTER TABLE `ppc_ads` ADD `updatedtime` int not null default '0';" );
    ( "update `ppc_ads` set updatedtime=createtime" );
    echo ( );
}
if ( $pausestatus == 0 )
{
    ( "ALTER TABLE `ppc_ads` ADD `pausestatus` int not null default '0';" );
    echo ( );
}
if ( $wapstatusflag == 0 )
{
    ( "ALTER TABLE `ppc_ads` ADD `wapstatus` int not null default '0';" );
    echo ( );
}
if ( $adlanguage == 0 )
{
    ( "ALTER TABLE `ppc_ads` ADD `adlang` int not null default '0';" );
    echo ( );
}
if ( $adname == 0 )
{
    ( "ALTER TABLE `ppc_ads` ADD `name` varchar(100)  not null default '';" );
    echo ( );
}
( "CREATE TABLE IF NOT EXISTS `inout_ppc_ipns` (\r\n  `ipnid` int(20) NOT NULL auto_increment,\r\n  `txnid` varchar(50) NOT NULL default '',\r\n  `userid` int(2) NOT NULL default '0',\r\n  `result` enum('0','1') NOT NULL default '0',\r\n  `resultdetails` varchar(50) NOT NULL default '',\r\n  `itemname` varchar(50) NOT NULL default '',\r\n  `itemnumber` varchar(25) NOT NULL default '',\r\n  `amount` float NOT NULL default '0',\r\n  `currency` varchar(10) NOT NULL default '',\r\n  `payeremail` varchar(50) NOT NULL default '',\r\n  `receiveremail` varchar(50) NOT NULL default '',\r\n  `paymenttype` varchar(25) NOT NULL default '',\r\n  `verified` varchar(25) NOT NULL default '',\r\n  `status` varchar(25) NOT NULL default '',\r\n  `pendingreason` varchar(25) NOT NULL default '',\r\n  `fullipn` text NOT NULL,\r\n  `receivedat` datetime NOT NULL default '0000-00-00 00:00:00',\r\n  `timestamp` timestamp(14) NOT NULL,\r\n  PRIMARY KEY  (`ipnid`),\r\n  KEY `result` (`result`),\r\n  KEY `userid` (`userid`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
( "CREATE TABLE IF NOT EXISTS `ppc_public_service_ads` (\r\n  `id` int(11) NOT NULL auto_increment,\r\n  `link` longtext NOT NULL,\r\n  `title` varchar(255) default NULL,\r\n  `summary` longtext NOT NULL,\r\n  `createtime` int(11) NOT NULL default '0',\r\n  `bannersize` int(11) default '0',\r\n  `adtype` int(11) NOT NULL default '0',\r\n  `status` int(11) NOT NULL default '1',\r\n  `displayurl` longtext,\r\n  `lastacesstime` int(11) NOT NULL default '0',\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
$tblcolums = ( "SHOW COLUMNS FROM `ppc_public_service_ads`" );
$wapstatusflag = 0;
$adl = 0;
$public_name = 0;
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "wapstatus" )
    {
        $wapstatusflag = 1;
    }
    if ( $row['Field'] == "adlang" )
    {
        $adl = 1;
    }
    if ( $row['Field'] == "name" )
    {
        $public_name = 1;
    }
}
if ( $wapstatusflag == 0 )
{
    ( "ALTER TABLE `ppc_public_service_ads` ADD `wapstatus` int not null default '0';" );
    echo ( );
}
if ( $adl == 0 )
{
    ( "ALTER TABLE `ppc_public_service_ads` ADD `adlang` int not null default '0';" );
    echo ( );
}
if ( $public_name == 0 )
{
    ( "ALTER TABLE `ppc_public_service_ads` ADD `name` VARCHAR(100)  not null default '';" );
    echo ( );
}
if ( $flag_publisher_credit == 0 )
{
    ( "CREATE TABLE IF NOT EXISTS `ppc_publisher_credits` (\r\n\t  `id` int(11) NOT NULL auto_increment,\r\n\t  `credit` varchar(255) NOT NULL default '',\r\n\t  PRIMARY KEY  (`id`)\r\n\t) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
    echo ( );
    ( "insert into ppc_publisher_credits values('0','Ads by adserver');" );
}
$languageid = 0;
$parentid = 0;
$credittypeflag = 0;
$tblcolums = ( "SHOW COLUMNS FROM `ppc_publisher_credits`" );
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "language_id" )
    {
        $languageid = 1;
    }
    if ( $row['Field'] == "parent_id" )
    {
        $parentid = 1;
    }
    if ( $row['Field'] == "credittype" )
    {
        $credittypeflag = 1;
    }
}
if ( $languageid == 0 )
{
    ( "ALTER TABLE `ppc_publisher_credits` ADD `language_id` int(11) NOT NULL default '0';" );
    echo ( );
}
if ( $parentid == 0 )
{
    ( "ALTER TABLE `ppc_publisher_credits` ADD `parent_id` int(11) NOT NULL default '0';" );
    echo ( );
}
if ( $credittypeflag == 0 )
{
    ( "ALTER TABLE `ppc_publisher_credits` ADD `credittype` INT NOT NULL DEFAULT '0';" );
    echo ( );
}
( "CREATE TABLE IF NOT EXISTS `ppc_publisher_payment_details` (\r\n  `id` int(11) NOT NULL auto_increment,\r\n  `uid` int(11) NOT NULL default '0',\r\n  `paymentmode` int(11) NOT NULL default '0',\r\n  `paypalemail` varchar(255) default NULL,\r\n  `payeename` varchar(255) default NULL,\r\n  `address1` longtext,\r\n  `address2` longtext,\r\n  `city` varchar(255) default NULL,\r\n  `state` varchar(255) default NULL,\r\n  `country` varchar(255) default NULL,\r\n  `zip` varchar(255) default NULL,\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
$acc_no = 0;
$routing_no = 0;
$acc_type = 0;
$bank_name = 0;
$bank_address = 0;
$b_city = 0;
$b_state = 0;
$b_country = 0;
$b_zip = 0;
$tblcolums = ( "SHOW COLUMNS FROM `ppc_publisher_payment_details` " );
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "acc_no" )
    {
        $acc_no = 1;
    }
    if ( $row['Field'] == "routing_no" )
    {
        $routing_no = 1;
    }
    if ( $row['Field'] == "acc_type" )
    {
        $acc_type = 1;
    }
    if ( $row['Field'] == "bank_name" )
    {
        $bank_name = 1;
    }
    if ( $row['Field'] == "bank_address" )
    {
        $bank_address = 1;
    }
    if ( $row['Field'] == "b_city" )
    {
        $b_city = 1;
    }
    if ( $row['Field'] == "b_state" )
    {
        $b_state = 1;
    }
    if ( $row['Field'] == "b_country" )
    {
        $b_country = 1;
    }
    if ( $row['Field'] == "b_zip" )
    {
        $b_zip = 1;
    }
}
if ( $acc_no == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`  ADD `acc_no` LONGTEXT {$charset_collation} ;" );
    echo ( );
}
if ( $routing_no == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`  ADD `routing_no` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $acc_type == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`   add `acc_type` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $bank_name == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`   add `bank_name` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $bank_address == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`  ADD `bank_address` LONGTEXT {$charset_collation} ;" );
    echo ( );
}
if ( $b_city == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`  ADD `b_city` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $b_state == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`  ADD `b_state` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $b_country == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`  ADD `b_country` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
if ( $b_zip == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_details`  ADD `b_zip` VARCHAR(255) {$charset_collation} NOT NULL;" );
    echo ( );
}
( "CREATE TABLE IF NOT EXISTS `ppc_publisher_payment_hist` (\r\n  `id` int(11) NOT NULL auto_increment,\r\n  `uid` int(11) NOT NULL default '0',\r\n  `reqdate` int(11) NOT NULL default '0',\r\n  `paymode` int(11) NOT NULL default '0',\r\n  `txid` varchar(255) default NULL,\r\n  `payeedetails` varchar(255) NOT NULL default '',\r\n  `payerdetails` longtext NOT NULL,\r\n  `amount` float NOT NULL default '0',\r\n  `currency` varchar(255) NOT NULL default '',\r\n  `status` int(11) NOT NULL default '0',\r\n  `processdate` int(11) default NULL,\r\n  `address1` longtext NOT NULL,\r\n  `address2` longtext NOT NULL,\r\n  `city` varchar(255) NOT NULL default '',\r\n  `state` varchar(255) NOT NULL default '',\r\n  `country` varchar(255) NOT NULL default '',\r\n  `zip` varchar(255) NOT NULL default '',\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
$tblcolums = ( "SHOW COLUMNS FROM `ppc_publisher_payment_hist`" );
$bank_name = 0;
$bank_address = 0;
$acc_no = 0;
$routing_no = 0;
$acc_type = 0;
$b_city = 0;
$b_state = 0;
$b_country = 0;
$b_zip = 0;
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "bank_name" )
    {
        $bank_name = 1;
    }
    if ( $row['Field'] == "bank_address" )
    {
        $bank_address = 1;
    }
    if ( $row['Field'] == "acc_no" )
    {
        $acc_no = 1;
    }
    if ( $row['Field'] == "routing_no" )
    {
        $routing_no = 1;
    }
    if ( $row['Field'] == "acc_type" )
    {
        $acc_type = 1;
    }
    if ( $row['Field'] == "b_city" )
    {
        $b_city = 1;
    }
    if ( $row['Field'] == "b_state" )
    {
        $b_state = 1;
    }
    if ( $row['Field'] == "b_country" )
    {
        $b_country = 1;
    }
    if ( $row['Field'] == "b_zip" )
    {
        $b_zip = 1;
    }
}
if ( $bank_name == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `bank_name` varchar(255) not null default '';" );
    echo ( );
}
if ( $bank_address == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `bank_address` longtext not null  default '' ;" );
    echo ( );
}
if ( $acc_no == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `acc_no` longtext NOT NULL   default '';" );
    echo ( );
}
if ( $routing_no == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `routing_no` varchar(255) NOT NULL default '';" );
    echo ( );
}
if ( $acc_type == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `acc_type` varchar(255) NOT NULL default '';" );
    echo ( );
}
if ( $b_city == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `b_city` varchar(255) NOT NULL default '';" );
    echo ( );
}
if ( $b_state == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `b_state` varchar(255) NOT NULL default '';" );
    echo ( );
}
if ( $b_country == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `b_country` varchar(255) NOT NULL default '';" );
    echo ( );
}
if ( $b_zip == 0 )
{
    ( "ALTER TABLE `ppc_publisher_payment_hist` ADD `b_zip` varchar(255) NOT NULL default '';" );
    echo ( );
}
( "CREATE TABLE IF NOT EXISTS `ppc_restricted_sites` (\r\n  `id` int(11) NOT NULL auto_increment,\r\n  `uid` int(11) NOT NULL default '0',\r\n  `site` varchar(255) NOT NULL default '',\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
( " CREATE TABLE  IF NOT EXISTS `ppc_fraud_clicks` (\r\n`id` INT NOT NULL AUTO_INCREMENT ,\r\n`aid` INT NOT NULL ,\r\n`pid` INT NOT NULL DEFAULT '0',\r\n`clicktime` INT NOT NULL ,\r\n`ip` VARCHAR( 255 ) NOT NULL ,\r\n`publisherfraudstatus` INT NOT NULL  DEFAULT '0',\r\nPRIMARY KEY ( `id` )\r\n)ENGINE=InnoDB {$charset_collation}  AUTO_INCREMENT=1 ;" );
echo ( );
$usr_bidflag = 0;
$usr_vidflag = 0;
$tblcolums = ( "SHOW COLUMNS FROM `ppc_fraud_clicks`" );
while ( $row = ( $tblcolums ) )
{
    if ( $row['Field'] == "bid" )
    {

Re: Hello Please any can solved my problem

Posted: Sun Mar 16, 2014 12:12 pm
by Christopher
If you look at line 49 there appears to be some missing logic in your expression:

Code: Select all

        if ( !( ( $tab1['Engine'] "InnoDB" ) != 0 ) && ( "alter table {$tab1['0']} ENGINE='InnoDB'" ) )
What are you trying to check with this if() ?