MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 28th, 2005, 06:41 PM
Beni_postal Beni_postal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 3 Beni_postal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 20 sec
Reputation Power: 0
parse error unexpected $

just started trying to make a registration script, pretty new to this so dont really know what im doing, any help would be apreaciated thanks. Keeps coming up with

Parse error: parse error, unexpected $ in XX/register.php on line 26


PHP Code:
 mysql_query("CREATE TABLE login_tbl(
id INT NOT NULL AUTO_INCREMENT, 
PRIMARY KEY(id),
loginid VARCHAR(30), 
password VARCHAR(15),
email VARCHAR(60)"
)
or die(
mysql_error());
$sql="INSERT INTO login_tbl (loginid, password and email) VALUES (".$loginid.",".$password.",".$email.")”;
$r = mysql_query($sql); 
 
if(!$r) {
 
$err=mysql_error();
 
print $err;
 
exit(); }
 
?> 

Reply With Quote
  #2  
Old May 28th, 2005, 06:57 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
Which is line 26?
__________________
"A pawn is the most important piece on the chessboard -- to a pawn"


Reply With Quote
  #3  
Old May 28th, 2005, 06:58 PM
Beni_postal Beni_postal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 3 Beni_postal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 20 sec
Reputation Power: 0
Quote:
Originally Posted by Madpawn
Which is line 26?


last line with the

PHP Code:
 ?> 

Reply With Quote
  #4  
Old May 28th, 2005, 07:02 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
You've got some funny quotes closing your INSERT statement line that may be the problem -- try changing them to a normal ".

Reply With Quote
  #5  
Old May 28th, 2005, 07:06 PM
Beni_postal Beni_postal is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 3 Beni_postal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 20 sec
Reputation Power: 0
Thanks that helped alot..

is there any problems with the syntax aswell because that seems to be a problem now..
on line 6 being the

PHP Code:
 mysql_query("CREATE TABLE login_tbl(
id INT NOT NULL AUTO_INCREMENT, 
PRIMARY KEY(id),
loginid VARCHAR(30), 
password VARCHAR(15),
email VARCHAR(60)"
)
or die(
mysql_error()); 


and onwards

beni

Reply With Quote
  #6  
Old May 28th, 2005, 07:10 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
You're missing a closing parentheses at the end of your create statement.

You shouldn't have the create statement in there anyway, though -- you'll only be able to run the script once; you'll get a 'table already exists' error thereafter.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > parse error unexpected $


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT