• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP/MySQL error I can't figure out

ShadowBlade

Diamond Member
Error:
Parse error: syntax error, unexpected T_STRING

Everything I can find tells me I'm missing a semicolon or quote or something, but I've sat and stared at this tidbit for 20 minutes and can't find anything missing.
 
Your mysql_close() function is wrong. mysql_close() takes a resource identifier, which is returned by mysql_open(). So, change it to $db = mysql_open("localhost","tlyon"); and mysql_close($db);

That should do it.
 
Well I did that and the error is no longer on line 6, and is now on line 7.

EDIT:
Updated code, below. (I also realized I hadn't selected a database, so I added that line, probably just pushed the error down)
 
Thanks hg403 - I figured it out before you responded 🙂
Also, in case anyone else reads this, it needs to be mysql_connect instead of mysql_open (i.e. different from what drebo said above)
 
You're right. PHP is no longer my primary web development language. open...connect...same diff. 😛
 
Back
Top