Page 1 of 1

Super Newb/parse error

Posted: Wed Apr 05, 2006 1:05 pm
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]

Posted: Wed Apr 05, 2006 1:11 pm
by feyd
post the the few lines before and after this line please.

Posted: Wed Apr 05, 2006 1:12 pm
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.

Posted: Wed Apr 05, 2006 1:16 pm
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]

Posted: Wed Apr 05, 2006 1:19 pm
by Burrito
you're missing a concat operator (.) on your query

Posted: Wed Apr 05, 2006 1:23 pm
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!

Posted: Wed Apr 05, 2006 1:26 pm
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.

Posted: Wed Apr 05, 2006 1:29 pm
by mbshaf4
O...wow....thank you very much!