Parse error, unexpected T_STRING on line 26, but I don't see it

Reply

Join Date: Jul 2004
Posts: 1
Reputation: raine is an unknown quantity at this point 
Solved Threads: 0
raine raine is offline Offline
Newbie Poster

Parse error, unexpected T_STRING on line 26, but I don't see it

 
0
  #1
Jul 30th, 2004
<?
$connect = mysql_connect("localhost", "adamf", "adamf123") or
die ("Wrong password, jerk.");

mysql_select_db ("adamf");

$insert="INSERT INTO product (product_id, product_name, product_type, product_brand, product_year)
VALUES (1, 'Cyber', 1, 1, 2001),
(2, 'Motive', 8, 1, 2005),
(3, 'Oracle', 8, 2, 2005)";
$results = mysql_query($insert)
or die(mysql_error());

$type="INSERT INTO producttype (producttype_id, producttype_label)
VALUES (1, 'Heads'),
(2, 'Shafts'),
(3, 'Helmets'),
(4, 'Gloves'),
(5, 'Arm Pads'),
(6, 'Shoulder Pads'),
(7, 'Stringing'),
(8, 'New'),
$results=mysql_query($type)
or die(mysql_error());

echo "Data inserted successfully!";
?>

okay, line 26 is the "echo "Data inserted successfully!"; line, so, my guess is the line above it has the error. However, I don't see what the heck it could be. I'm pretty much copying this out of the wrox book "PHP, Apache, MySQL Web Developement", just with different words and other such things, so it isn't a movie site. I've probably looked at this for 20 minutes, could anybody tell me what's wrong?
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: Parse error, unexpected T_STRING on line 26, but I don't see it

 
0
  #2
Jul 31st, 2004
[PHP]<?
$connect = mysql_connect("localhost", "adamf", "adamf123") or
die ("Wrong password, jerk.");

mysql_select_db ("adamf");

$insert="INSERT INTO product (product_id, product_name, product_type, product_brand, product_year)
VALUES (1, 'Cyber', 1, 1, 2001),
(2, 'Motive', 8, 1, 2005),
(3, 'Oracle', 8, 2, 2005)";
$results = mysql_query($insert)
or die(mysql_error());

$type="INSERT INTO producttype (producttype_id, producttype_label)
VALUES (1, 'Heads'),
(2, 'Shafts'),
(3, 'Helmets'),
(4, 'Gloves'),
(5, 'Arm Pads'),
(6, 'Shoulder Pads'),
(7, 'Stringing'),
(8, 'New')";
$results=mysql_query($type)
or die(mysql_error());

echo "Data inserted successfully!";
?>[/PHP]

According to your error, in your code you forgot to put "; in the end of $type sentence. Hope it works. If this is not, insert data row by row.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 2
Reputation: biscovaldo is an unknown quantity at this point 
Solved Threads: 0
biscovaldo biscovaldo is offline Offline
Newbie Poster

Re: Parse error, unexpected T_STRING on line 26, but I don't see it

 
0
  #3
Jun 24th, 2009
Good answer. I solved my problem too.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,402
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 224
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: Parse error, unexpected T_STRING on line 26, but I don't see it

 
0
  #4
Jun 24th, 2009
Originally Posted by biscovaldo View Post
Good answer. I solved my problem too.
I'm sure he heard you. By the way, can I borrow your necronomicon so I can resurrect the dead as well? Come on, this thread is over 5 years old
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 2
Reputation: biscovaldo is an unknown quantity at this point 
Solved Threads: 0
biscovaldo biscovaldo is offline Offline
Newbie Poster

Re: Parse error, unexpected T_STRING on line 26, but I don't see it

 
0
  #5
Jul 23rd, 2009
Originally Posted by ShawnCplus View Post
I'm sure he heard you. By the way, can I borrow your necronomicon so I can resurrect the dead as well? Come on, this thread is over 5 years old
I'm just new at online foruns.

Probably he will not hear me, but oder IT curious like me will see the answer. I'm not a IT professional. Just learning a little bit.

See you.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC