...

View Full Version : Turning this into the proper syntax



HackSawed
07-24-2006, 01:08 PM
Could anybody help?

Basically whats happened is on my forum I have installed a casino and with the package I installed came a page that automatically installed the mySQL syntax. This wont work, so I have to do it manually, and given that I have no idea how to deal with mySQL (only familiar with php and html), I have no idea where to turn but here.


$sql = array();
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_playprice', '2')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_aceofclubs', '15')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_aceofdiamonds', '20')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_aceofhearts', '25')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_aceofspades', '30')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_onoff', 'on')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_minorprize', '5')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_given', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_taken', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('chance_played', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_playprice', '2')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_apple', '15')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_banana', '20')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_orange', '25')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_starfruit', '30')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_onoff', 'on')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_minorprize', '5')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_given', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_taken', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('slot_played', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_enable', '1')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_maxbet', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_windouble', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_wintriple', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_winperfect', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_bonussmall', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_bonusbig', '')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_played', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_taken', '0')";
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) values ('luckydice_given', '0')";

$sql[] = "CREATE TABLE " . $table_prefix . "blackjack_refresh (
player int(10) NOT NULL default '0',
card1 int(3) NOT NULL default '0',
card2 text NOT NULL,
card3 int(3) NOT NULL default '0',
card4 text NOT NULL
) TYPE=MyISAM";

$sql[] = "CREATE TABLE " . $table_prefix . "keno_game (
played int(20) NOT NULL default '0',
points_given int(20) NOT NULL default '0',
points_taken int(20) NOT NULL default '0'
) TYPE=MyISAM";

$sql[] = "INSERT INTO " . $table_prefix . "keno_game (played, points_given, points_taken) VALUES ('0', '0', '0')";

$sql[] = "CREATE TABLE " . $table_prefix . "blackjack_cards (
number int(2) NOT NULL default '0',
value text NOT NULL
) TYPE=MyISAM";

$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('1', 'Two Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('2', 'Three Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('3', 'Four Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('4', 'Five Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('5', 'Six Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('6', 'Seven Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('7', 'Eight Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('8', 'Nine Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('9', 'Ten Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('10', 'Jack Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('11', 'Queen Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('12', 'King Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('13', 'Ace Of Clubs')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('14', 'Two Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('15', 'Three Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('16', 'Four Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('17', 'Five Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('18', 'Six Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('19', 'Seven Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('20', 'Eight Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('21', 'Nine Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('22', 'Ten Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('23', 'Jack Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('24', 'Queen Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('25', 'King Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('26', 'Ace Of Diamonds')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('27', 'Two Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('28', 'Three Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('29', 'Four Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('30', 'Five Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('31', 'Six Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('32', 'Seven Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('33', 'Eight Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('34', 'Nine Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('35', 'Ten Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('36', 'Jack Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('37', 'Queen Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('38', 'King Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('39', 'Ace Of Hearts')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('40', 'Two Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('41', 'Three Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('42', 'Four Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('43', 'Five Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('44', 'Six Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('45', 'Seven Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('46', 'Eight Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('47', 'Nine Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('48', 'Ten Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('49', 'Jack Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('50', 'Queen Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('51', 'King Of Spades')";
$sql[] = "INSERT INTO " . $table_prefix . "blackjack_cards (number, value) VALUES ('52', 'Ace Of Spades')";

$sql[] = "CREATE TABLE " . $table_prefix . "blackjack_info (
given int(20) NOT NULL default '0',
taken int(20) NOT NULL default '0',
wins int(20) NOT NULL default '0',
losses int(20) NOT NULL default '0',
ties int(20) NOT NULL default '0',
re_dealt int(20) NOT NULL default '0'
) TYPE=MyISAM";

$sql[] = "INSERT INTO " . $table_prefix . "blackjack_info (given, taken, wins, losses, ties, re_dealt) VALUES ('0', '0', '0', '0', '0', '0')";

Beagle
07-24-2006, 03:35 PM
I don't see any table with the word "config" in there name at all. That would be a problem considering your first block of inserts are all for $table."config"

HackSawed
07-25-2006, 01:48 PM
still unsure what you mean?

guelphdad
07-25-2006, 02:07 PM
This:
"INSERT INTO " . $table_prefix . "config says you want to enter the rows of data into a table called config. Looking at the code you have posted there is no table created that is called config.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum