Super Newb/parse error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mbshaf4
Forum Newbie
Posts: 11
Joined: Wed Apr 05, 2006 1:01 pm

Super Newb/parse error

Post by mbshaf4 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I am very new to php and kinda rushed through the basics.  I cant figure out the problem with this line of code.

Code: Select all

echo '<table align="center" cellspacing="0" cellpadding="5" bgcolor="white" border="1">
    <tr><td bgcolor="#FFFF99" align="center"><b>Title</b></td><td align="center"><b>Format</b></td><td bgcolor="#FFFF99" align="center"><b>Price</b></td><td align="center"><b>Negotiable</b></td><td bgcolor="#FFFF99" align="center">Trade</td><td align="center">Edit</td><td align="center" bgcolor="#FFFF99">Delete</td></tr>
';
There aren't any errors before this line and can't figure out why im getting an unexpected T_String error.

Thank you for dealing with my newbiness.

Matt


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

post the the few lines before and after this line please.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

after 'glancing' over that line...it looks to be fine.

more than likely it's something above it.

post some more code preceding that line and I'll take a look.
mbshaf4
Forum Newbie
Posts: 11
Joined: Wed Apr 05, 2006 1:01 pm

Post by mbshaf4 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

require_once ('');         //db connect

$query = "SELECT * FROM `gr` WHERE `user_id` = '$_COOKIE[user_id]';
$result = @mysql_query ($query); // Run the query.

if ($result) { // If it ran OK, display the records.

                echo '<h6>Your Games:</h6>';

	// Table header.
	echo '<table align="center" cellspacing="0" cellpadding="5" bgcolor="white" border="1">
    <tr><td bgcolor="FFFF99" align="center"><b>Title</b></td><td align="center"><b>Format</b></td><td bgcolor="FFFF99" align="center"><b>Price</b></td><td align="center"><b>Negotiable</b></td><td bgcolor="FFFF99" align="center">Trade</td><td align="center">Edit</td><td align="center" bgcolor="FFFF99">Delete</td></tr>
';




}
I have copied and pasted the code above from another of my pages that worked. I still am not seeing anything.
Thanks in advance!


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you're missing a concat operator (.) on your query
mbshaf4
Forum Newbie
Posts: 11
Joined: Wed Apr 05, 2006 1:01 pm

Post by mbshaf4 »

could you please explain in a bit more detail...this query works on my other pages. Could you tell me where i need the concat (.)

Thank you very much!
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Code: Select all

$query = "SELECT * FROM `gr` WHERE `user_id` = '{$_COOKIE[user_id]}'";
apologies...it wasn't the concat...you were missing the closing quote on your query line...also when using an array var like that, you should put curly braces around the var.
mbshaf4
Forum Newbie
Posts: 11
Joined: Wed Apr 05, 2006 1:01 pm

Post by mbshaf4 »

O...wow....thank you very much!
Post Reply