MySQL_Narb Posted October 20, 2009 Share Posted October 20, 2009 Error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/runevid/public_html/Quests/finished_tutorial.php on line 18 Code: <?php session_start(); ?> <html> <head> <title>CrazyQuest - The online website for quests!</title> <link type="text/css" href="style.css" rel="stylesheet" media="screen" /> </head> <body> <center> <div id="container" > <div id="banner" > <img src="Images/logo.png" alt="" width="414" height="56" border="0" /> <h1>CrazyQuest</h1> </div> <?php $username = "$_SESSION['username']"; //connect $connect = mysql_connect("localhost","","") or die("Connection failed!"); mysql_select_db("") or die("Database fail!"); //write $update_complete = mysql_query("UPDATE users SET quest1 = quest1 + 1 WHERE username='$username'"); $points = mysql_query("UPDATE users SET points = points + 3 WHERE username='$username'"); echo "<b><span style='color:green'>You have completed quest and gained 3 points!</span></b>"; } ?> <div id="footer"><h1>Copyright 2009 - CrazyQuest</h1></div> Quote Link to comment https://forums.phpfreaks.com/topic/178293-why-do-i-get-this-error/ Share on other sites More sharing options...
MadTechie Posted October 20, 2009 Share Posted October 20, 2009 $username = "$_SESSION['username']"; should be $username = $_SESSION['username']; echo "<b><span style='color:green'>You have completed quest and gained 3 points!</span></b>"; } //<----Whats that closing ? ?> Quote Link to comment https://forums.phpfreaks.com/topic/178293-why-do-i-get-this-error/#findComment-940126 Share on other sites More sharing options...
mrMarcus Posted October 20, 2009 Share Posted October 20, 2009 i believe i see you with the same thread at least once a day .. you should really save yourself some time and learn why these errors are occurring so you can prevent or rectify them yourself. i know this is a help forum, and i wouldn't want to take away from that, but you should really look into Parse Errors if you plan on continuing with PHP in the future. just an observation. Quote Link to comment https://forums.phpfreaks.com/topic/178293-why-do-i-get-this-error/#findComment-940151 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.