gli Posted April 18, 2008 Share Posted April 18, 2008 <?php $skypename = $_POST['skypename']; $result = mysql_query("UPDATE users SET skypename='$skypename' WHERE id='$_SESSION['id']'") or die(mysql_error()); ?> when i add WHERE id='$_SESSION['id']' then Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/jimperija.atwebpages.com/settingsprocess.php on line 7 where is the problem in my code ? thanks Quote Link to comment Share on other sites More sharing options...
Zhadus Posted April 18, 2008 Share Posted April 18, 2008 <?php $skypename = $_POST['skypename']; $result = mysql_query('UPDATE users SET skypename=\"' . $skypename . '\" WHERE id=\"' . $_SESSION['id'] . '\"') or die(mysql_error()); ?> You are using the single and double quotations incorrectly. Quote Link to comment Share on other sites More sharing options...
gli Posted April 18, 2008 Author Share Posted April 18, 2008 thnx. but now there is new error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"lolozz\" WHERE id=\"\"' at line 1 Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted April 18, 2008 Share Posted April 18, 2008 Try this: $result = mysql_query('UPDATE users SET skypename= '$skypename' WHERE id="' . $_SESSION['id'] . '"') Quote Link to comment Share on other sites More sharing options...
gli Posted April 18, 2008 Author Share Posted April 18, 2008 ouh zhadus thnx all was okey. denis thnx but in your code was some error. thnx guys Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted April 18, 2008 Share Posted April 18, 2008 sorry yeah try this: $result = mysql_query('UPDATE users SET skypename= '$skypename' WHERE id='" . $_SESSION['id'] . "'") Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted April 18, 2008 Share Posted April 18, 2008 did this work? Quote Link to comment Share on other sites More sharing options...
morph07 Posted April 18, 2008 Share Posted April 18, 2008 back to start... from your first post, the code: WHERE id='$_SESSION['id']' you must revised it to WHERE id='$_SESSION["id"]' another option is to assigning it to another variable.... Quote Link to comment Share on other sites More sharing options...
jonsjava Posted April 18, 2008 Share Posted April 18, 2008 <?php $skypename = $_POST['skypename']; $result = mysql_query("UPDATE users SET skypename='$skypename' WHERE id='{$_SESSION['id']}';") or die(mysql_error()); ?> Quote Link to comment 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.