User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 402,510 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,719 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 600 | Replies: 4
Reply
Join Date: Feb 2008
Posts: 1
Reputation: ajf7688 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ajf7688 ajf7688 is offline Offline
Newbie Poster

Help required with .sql file!

  #1  
Feb 25th, 2008
Well n not a mysql expert so i need help with this sql file here r d contents of it.


Quote:
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`)
)";

"insert into admin set username='$admin_login',password='$admin_pass',web master_email='$admin_email'";


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`)
)";

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`)
)";

"insert into admin_settings set id='1'";

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`)
)";


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)
)";


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 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)
)";

"INSERT INTO emails VALUES (1, 'Email sent to first time users after payment', 'Welcome', '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', '', '')";


"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 HIT-Pro-Software.com.\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', '', '')";

"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', '', '')";

"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 for your support!\r\nAdmin\r\n', '', '')";



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`)
)";


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



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)
)";


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`)
)";



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' 
)";


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)
)";


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`)
)";


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`)
)";


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`)
)";


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`)
)";



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)
)";  

Here is the error i get wen i import the sql file!

Quote:
Error
SQL query: 

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` ) 
) ";

" INSERT INTO admin
SET username = '$admin_login',
PASSWORD = '$admin_pass',
webmaster_email = '$admin_email' ";


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`)
)";



MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '";

"insert into admin set username='$admin_login',password='$admin_pass',web m' at line 8


__________________
Last edited by peter_budo : Feb 27th, 2008 at 2:29 pm. Reason: Please use [code] tags even for SQL queries, also use full-sentence English. Please do not use "leet" speak or "chatroom" speak.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Posts: 9
Reputation: Jake Kittell is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Jake Kittell Jake Kittell is offline Offline
Newbie Poster

Re: Help required with .sql file!

  #2  
Feb 26th, 2008
I suggest that you try one section at a time for starters. Also, your sintax should not have " around things except for literals. Each statement should not end with one.
Reply With Quote  
Join Date: Feb 2008
Posts: 5
Reputation: latha_nov is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
latha_nov latha_nov is offline Offline
Newbie Poster

Help Re: Help required with .sql file!

  #3  
Feb 28th, 2008
Try to execute sub queries seperately and check out for the syntax ,it might work out then
Reply With Quote  
Join Date: Dec 2004
Location: UAE
Posts: 406
Reputation: Sulley's Boo will become famous soon enough Sulley's Boo will become famous soon enough 
Rep Power: 5
Solved Threads: 9
Sulley's Boo's Avatar
Sulley's Boo Sulley's Boo is offline Offline
Posting Pro in Training

Question Re: Help required with .sql file!

  #4  
Feb 29th, 2008
Originally Posted by ajf7688 View Post
Well n not a mysql expert so i need help with this sql file here r d contents of it.


Quote:[code]
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`)
)";

"insert into admin set username='$admin_login',password='$admin_pass',web_master_email='$admin_email'";

Maybe your field name is wrong ..
Reply With Quote  
Join Date: Dec 2007
Posts: 112
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 13
mwasif mwasif is offline Offline
Junior Poster

Re: Help required with .sql file!

  #5  
Mar 2nd, 2008
In addition to above suggesstions:
If you are executing this file using mysql or source commands, then you have to use the values instead of PHP variables e.g.

"insert into admin set username='$admin_login',password='$admin_pass',web master_email='$admin_email'";
Should be
insert into admin set username='some admin login',password='password here',web master_email='email@example.com';
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 6:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC