techiefreak05 Posted August 12, 2006 Share Posted August 12, 2006 Hi, Im trying to make a simple form where users can update their info.. right now tis super simple, just so i can understand it and advance it later... this code doesnt woprk.. although it doesnt produce any errors... it doesnt update thier email...[code]<?phpif($_POST['submit1']){$conn = mysql_connect("localhost", "zyco", "****") or die(mysql_error());mysql_select_db('zyco_zycologin', $conn) or die(mysql_error());$cNewEmail = $_POST['emailNew'];$idg = $_SESSION['username'];$query = "UPDATE `users` SET `email` = '$cNewEmail' WHERE `username` = $idg LIMIT 1 ";mysql_query($query) or die('Error : ' . mysql_error() );}?><table align="center" border="0" cellspacing="0" cellpadding="3"><tr><td ><font color=black>New Email:</font></td><td><input type="text" name="emailNew" maxlength="30"></td></tr><tr><td colspan="2" align="right"><input type="submit" name="submit1" value="Update"></td></tr></table>[/code]What am i doing wrong..btw. the "***" in the password.. yes i really have my own password, like I said I dont get any DB errors.. or ANY errors at all. Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 12, 2006 Share Posted August 12, 2006 below your queryadd thisecho $query;I have also noticed in your query$idg needs to be in single quotes...WHERE username = '$idg' LIMIT... 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.