Jump to content

Recommended Posts

Guys,
I am install " Instant Split Commisions" and keep getting this error message

Parse error: parse error, unexpected $ in /home/audio/public_html/affil/install/createtables.php on line 255

thing is.. it only goes to line 254. or am I missing something reallly basic here
Sorry for the ignorance but I cant get the hummer to work
All help appreciated

Cheers
Link to comment
https://forums.phpfreaks.com/topic/10495-keep-getting-parse-error/
Share on other sites

[!--quoteo(post=377274:date=May 26 2006, 05:48 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ May 26 2006, 05:48 AM) [snapback]377274[/snapback][/div][div class=\'quotemain\'][!--quotec--]
There will be something wrong elsewhere in the file.

I used to get this sort of thing alot, giving me errors on line 197 or a file with only 44 lines for example.
[/quote]

I am posting the file here. Hope this is ok to do

<?

include ("database.class.php");
$db = new database;

// create admin table
$q = "CREATE TABLE `admin` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(255),
`password` varchar(255),
`webmaster_email` varchar(255),
`lastlogin` int(11),
PRIMARY KEY (`id`)
)";
$db->insert($q);

// insert into admin table
$q = "insert into admin set username='$admin_login',password='$admin_pass',webmaster_email='$admin_email'";
$db->insert($q);

// create admin session table
$q = "CREATE TABLE `admin_session` (
`admin_id` int(11) NOT NULL auto_increment,
`hash` varchar(255),
`timestamp` int(11),
`last_export` int(11),
PRIMARY KEY (`admin_id`)
)";
$db->insert($q);

// admin settings
$q="CREATE TABLE `admin_settings` (
`id` int(11) NOT NULL DEFAULT '0' ,
`help_url` varchar(255) ,
`email_from_name` varchar(255) ,
`email_subject` varchar(255) ,
`email_message` text ,
`paypal_email` varchar(255) ,
`stormpay_email` varchar(255) ,
`mailer_details` text ,
PRIMARY KEY (`id`)
)";
$db->insert($q);

// insert into admin_settings table
$q = "insert into admin_settings set id='1'";
$db->insert($q);

$q="CREATE TABLE `automated_emails` (
`id` int(10) unsigned NOT NULL auto_increment,
`product_id` int(10) unsigned ,
`subject` varchar(255) ,
`message` text ,
`rank` tinyint(3) unsigned ,
`delay` int(11) ,
PRIMARY KEY (`id`)
)";

$db->insert($q);


$q = "CREATE TABLE downloaded_products (
id INT (11) NOT NULL AUTO_INCREMENT,
member_id INT (11),
product_id INT (11),
downloaded INT (11) DEFAULT '0',
PRIMARY KEY(id)
)";

$db->insert($q);


$q="CREATE TABLE email_log (
`id` int(11) NOT NULL auto_increment,
`member_id` int(11) ,
`product_id` int(11) ,
`email_id` int(11) ,
`last_send` int(11) ,
PRIMARY KEY (`id`)
)";
$db->insert($q);


// create emails table
$q = "CREATE TABLE `emails` (
id int(11) unsigned NOT NULL auto_increment,
type varchar(255) ,
subject varchar(255) ,
message text ,
from_name varchar(255) ,
from_email varchar(255) ,
PRIMARY KEY (id)
)";
$db->insert($q);

// insert into emails table


$q = "INSERT INTO emails VALUES (1, 'Email sent to first time users after payment', 'Welcome to InstantSplitCommissions', 'Dear {firstname} {lastname}, \r\n\r\nThank You! for joining our site.\r\n\r\nNow you can start advertising and earn instantly for each sale you bring to us.\r\n\r\nYour Details,\r\n\r\nEmail : {email}\r\n\r\nUsername : {username}\r\n\r\nPassword : {password}\r\n\r\nFirst Name: {firstname}\r\n\r\nLast Name: {lastname}\r\n\r\nStormpay Email: {stormpay_email}\r\n\r\nPaypal Email: {paypal_email}\r\n\r\n\r\n\r\nThank you.\r\n\r\nAdmin', '', '')";
$db->insert($q);

$q = "INSERT INTO emails VALUES (2, 'Email sent to affiliates whenever a payment for a sale is made to them', 'You have got a Affiliate Sale', 'Dear {firstname}{lastname},\r\n\r\nYou have received a commission for one of your affilite products in InstantAffiliateCommissions.\r\n\r\nProduct Name : {product_name}\r\n\r\nYou Earned: ${ref_commission} \r\n\r\n\r\nLogin for more details.\r\n\r\nThank You!\r\nAdmin', '', '')";
$db->insert($q);

$q = "INSERT INTO emails VALUES (3, 'Email sent to admin whenever a payment/sale is made', 'A Sale Made', 'Dear Admin,\r\n\r\nA sale has been made.\r\n\r\nProduct Name : {product_name}\r\nProduct Cost : ${product_price}\r\n \r\nAffiliate Name: {firstname} {lastname}\r\nAffiliate Commission : ${ref_commission} \r\n\r\nYour Earning : ${admin_income}\r\n\r\nLogin for more details.\r\n\r\nThank You!\r\nAdmin', '', '')";
$db->insert($q);

$q = "INSERT INTO emails VALUES (4, 'Email sent to existing users after they purchase any other new products', 'Thank you for your purchase', 'Dear {firstname}{lastname},\r\n\r\nThank you for purchasing.\r\n\r\nProduct Name : {product_name}\r\n\r\nProduct Cost : ${product_price}\r\n\r\n\r\nThank You!\r\nAdmin\r\n', '', '')";
$db->insert($q);



$q="CREATE TABLE marketing_banners (
`id` int(11) NOT NULL auto_increment,
`product_id` int(11) ,
`banner_url` varchar(255) ,
`banner_image` varchar(255) ,
PRIMARY KEY (`id`)
)";

$db->insert($q);

$q="CREATE TABLE marketing_emails (
`id` int(11) NOT NULL auto_increment,
`product_id` int(11) ,
`subject` varchar(255) ,
`message` text ,
PRIMARY KEY (`id`)
)";

$db->insert($q);


$q = "CREATE TABLE mass_email (
id int(11) NOT NULL auto_increment,
subject varchar(255) ,
message text ,
from_name varchar(255) ,
from_email varchar(255) ,
mid text ,
PRIMARY KEY (id)
);
";

$db->insert($q);

$q="CREATE TABLE `member_products` (
`id` int(11) NOT NULL auto_increment,
`member_id` int(11) ,
`product_id` int(11) ,
`date_added` date ,
PRIMARY KEY (`id`)
)";

$db->insert($q);


$q="CREATE TABLE member_session (
`member_id` int(11) NOT NULL DEFAULT '0' ,
`hash` varchar(255) NOT NULL DEFAULT '' ,
`time` int(11) NOT NULL DEFAULT '0'
)";

$db->insert($q);

$q="CREATE TABLE `members` (
`id` int(11) NOT NULL auto_increment,
`firstname` varchar(255) ,
`lastname` varchar(255) ,
`email` varchar(255) NOT NULL DEFAULT '' ,
`username` varchar(255) NOT NULL DEFAULT '' ,
`password` varchar(255) ,
`paypal_email` varchar(255) ,
`stormpay_email` varchar(255) ,
`ip` varchar(255) ,
`date_joined` datetime DEFAULT '0000-00-00 00:00:00' ,
`status` int(11) DEFAULT '0' ,
`referrer_url` varchar(255) ,
`last_login` int(11) ,
`mailing` int(11) DEFAULT '1' ,
`randomstring` varchar(100) ,
PRIMARY KEY (id)
)";

$db->insert($q);

$q="CREATE TABLE `orders` (
`id` int(11) NOT NULL auto_increment,
`member_id` int(11) DEFAULT '0' ,
`product_id` int(11) NOT NULL DEFAULT '0' ,
`payment_type` int(11) ,
`visitor_id` int(11) ,
`paid` int(11) DEFAULT '0' ,
PRIMARY KEY (`id`)
)";

$db->insert($q);

$q="CREATE TABLE products (
`id` int(11) NOT NULL auto_increment,
`product_name` varchar(255) ,
`product_shortname` varchar(255) ,
`price` decimal(15,2) ,
`commission` decimal(15,2) ,
`pay_referrer_first` int(11) DEFAULT '0' ,
`date_added` datetime DEFAULT '0000-00-00 00:00:00' ,
`template_page` text ,
`download_link` varchar(255) ,
`membership_form` text ,
`show_affiliate_url` int(11) ,
`rank` int(11) ,
PRIMARY KEY (`id`)
)";

$db->insert($q);

$q="CREATE TABLE transaction (
`id` int(11) NOT NULL auto_increment,
`order_id` int(11) ,
`transaction_id` varchar(100) ,
`from_email` varchar(255) ,
`to_email` varchar(255) ,
`amount` double ,
`to_admin` int(11) DEFAULT '1' ,
PRIMARY KEY (`id`)
)";

$db->insert($q);

$q="CREATE TABLE visitor_stats (
`id` int(11) NOT NULL auto_increment,
`visited_date` date NOT NULL DEFAULT '0000-00-00' ,
`product_id` int(11) ,
`referrer` int(11) DEFAULT '0' ,
`ip` varchar(255) ,
`randomstring` varchar(255) ,
`order_placed` int(11) DEFAULT '0' ,
PRIMARY KEY (`id`)
)";

$db->insert($q);


$q = "CREATE TABLE ipn_args (
id int(11) NOT NULL auto_increment,
randomstring varchar(255) ,
mrand varchar(50) DEFAULT '0' ,
returnrand varchar(50) ,
PRIMARY KEY (id)
);

$db->insert($q);

?>
Did as directed above now get this message

CREATE TABLE `admin` ( `id` int(11) NOT NULL auto_increment, `username` varchar(255), `password` varchar(255), `webmaster_email` varchar(255), `lastlogin` int(11), PRIMARY KEY (`id`) ) 1050 Table 'admin' already exists

Any thoughts please?
[!--quoteo(post=377395:date=May 26 2006, 01:25 PM:name=macca31)--][div class=\'quotetop\']QUOTE(macca31 @ May 26 2006, 01:25 PM) [snapback]377395[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Did as directed above now get this message

CREATE TABLE `admin` ( `id` int(11) NOT NULL auto_increment, `username` varchar(255), `password` varchar(255), `webmaster_email` varchar(255), `lastlogin` int(11), PRIMARY KEY (`id`) ) 1050 Table 'admin' already exists

Any thoughts please?
[/quote]
simple:
[b]Table 'admin' already exists[/b]

drop it and create it again,
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.