angelsRock Posted October 12, 2007 Share Posted October 12, 2007 why state problem Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or '$' in C:\wamp\www\Property\agent-password.php on line 220 $connection=mysql_connect($server, $user, $pass); if(!$connection) die("Connection failed"); else { mysql_select_db($db); $query3="select * from all_members where email='".$_SESSION[username]."' and password='".$_POST[new]."'; "; $exec=mysql_query($query3); $num=mysql_affected_rows(); if($num<1) { echo'<script>alert("Sorry, submission failed")</script>'; } } Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/ Share on other sites More sharing options...
Herod Posted October 12, 2007 Share Posted October 12, 2007 please verify this $query3="select * from all_members where email='".$_SESSION[username]."' and password='".$_POST[new]."'; "; Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/#findComment-367584 Share on other sites More sharing options...
sneamia Posted October 12, 2007 Share Posted October 12, 2007 Shouldn't username and new be in quotes? Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/#findComment-367585 Share on other sites More sharing options...
angelsRock Posted October 12, 2007 Author Share Posted October 12, 2007 i don seen a syntax error there to change.. that query is to check the username and password to be matched when user change pasword Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/#findComment-367586 Share on other sites More sharing options...
Herod Posted October 12, 2007 Share Posted October 12, 2007 write $query3="select * from all_members where email='".$_SESSION[username]."' and password='".$_POST[new]."'; "; like this $query3="select * from all_members where email='".$_SESSION[username]."' and password='".$_POST[new]."'; Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/#findComment-367588 Share on other sites More sharing options...
angelsRock Posted October 12, 2007 Author Share Posted October 12, 2007 impossible.. cos "select ... " Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/#findComment-367589 Share on other sites More sharing options...
Herod Posted October 12, 2007 Share Posted October 12, 2007 ah yes make it like this: $query3="select * from all_members where email='".$_SESSION[username]."' and password='".$_POST[new]."'"; Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/#findComment-367590 Share on other sites More sharing options...
sneamia Posted October 12, 2007 Share Posted October 12, 2007 Did you try putting username and new in quotes? Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/#findComment-368134 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 <?php $query3="select * from all_members where email='".$_SESSION['username']."' and password='".$_POST['new']."'";?> Quote Link to comment https://forums.phpfreaks.com/topic/72879-solved-syntax-prob/#findComment-368139 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.