jarv Posted November 26, 2010 Share Posted November 26, 2010 can someone please help me, I get syntax error, unexpected '[' in my page here is my code: $query1 = "SELECT * FROM members WHERE rsUser = '".$rsUser."' AND rsPass = '".$rsPass."'"; $result1 = mysql_query($query1); $row1 = mysql_fetch_array($result1); $_SESSION['USERID']=row1['USERID']; $_SESSION['RSPOSTCODE']=row1['RSPOSTCODE']; $_SESSION['RSEMAIL']=row1['RSEMAIL']; $_SESSION['RSUSER']=row1['RSUSER']; $pSQL = "INSERT INTO favepub_COPY (USERID,PUBID)" $pSQL = $pSQL."SELECT ".$_SESSION["USERID").", PUBID " $pSQL = $pSQL."FROM pubs " $pSQL = $pSQL."WHERE left(rsPostCode,4) = '".$_SESSION["RSPOSTCODE")."'" Quote Link to comment https://forums.phpfreaks.com/topic/219893-syntax-error-unexpected/ Share on other sites More sharing options...
MrXHellboy Posted November 26, 2010 Share Posted November 26, 2010 Your syntax error should be gone <?php $query1 = "SELECT * FROM members WHERE rsUser = '".$rsUser."' AND rsPass = '".$rsPass."'"; $result1 = mysql_query($query1); $row1 = mysql_fetch_array($result1); $_SESSION['USERID']=row1['USERID']; $_SESSION['RSPOSTCODE']=row1['RSPOSTCODE']; $_SESSION['RSEMAIL']=row1['RSEMAIL']; $_SESSION['RSUSER']=row1['RSUSER']; $pSQL = "INSERT INTO favepub_COPY (USERID,PUBID)" $pSQL = $pSQL."SELECT ".$_SESSION["USERID"].", PUBID " $pSQL = $pSQL."FROM pubs " $pSQL = $pSQL."WHERE left(rsPostCode,4) = '".$_SESSION["RSPOSTCODE"]."'" ?> Quote Link to comment https://forums.phpfreaks.com/topic/219893-syntax-error-unexpected/#findComment-1139897 Share on other sites More sharing options...
revraz Posted November 26, 2010 Share Posted November 26, 2010 If you dont see the correction, you used the wrong closing tag here $_SESSION["USERID").", The error should have given you a line number. Quote Link to comment https://forums.phpfreaks.com/topic/219893-syntax-error-unexpected/#findComment-1139902 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.