karnegyhall Posted May 27, 2009 Share Posted May 27, 2009 <?php $conn = mysql_connect("**********.3869157.hostedresource.com", "[database]", "password"); if (!$conn) { die('Could not connect: ' . mysql_error()); } $select = mysql_select_db('sportstalkadmin', $conn); if (!$select) { die('could not select db: sportstalkadmin ' . mysql_error()); } $ID = $_SESSION['SESS_MEMBER_ID']; <?php $login = $_POST['Login']?><br />; <?php $lname = $_POST['Lname']?><br />; <?php $fname = $_POST['Fname']?><br />; <?php $jersey = $_POST['Jersey']?><br />; <?php $height = $_POST['Height']?><br />; <?php $weight = $_POST['Weight']?><br />; <?php $email = $_POST['Email']?><br />; $update = mysql_query("UPDATE tblathletes SET strEMailAddress = '$email' WHERE intAthleteID = '$ID'"); if (!$update) {header("location: sports-memberindex.php"); exit(); } die('Could not post your data: ' . mysql_error()); } mysql_close($con); the script processes and does not die. But when i go to the DB and do a SELECT statement on any of the fields i'm sending in the form. They're not there. thanks Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 27, 2009 Share Posted May 27, 2009 Look at your code. See the bottom PHP lines that are in black? You forgot to put them in <?php tags. Quote Link to comment Share on other sites More sharing options...
karnegyhall Posted May 27, 2009 Author Share Posted May 27, 2009 <?php $conn = mysql_connect ("********.db.3869157.hostedresource.com", "[database]", "[Password]"); if (!$conn) { die('Could not connect: ' . mysql_error()); } $select = mysql_select_db('sportstalkadmin', $conn); if (!$select) { die('could not select db: sportstalkadmin ' . mysql_error()); } $ID = $_SESSION['SESS_MEMBER_ID']; ?> <?php $login = $_POST['Login']?><br />; <?php $lname = $_POST['Lname']?><br />; <?php $fname = $_POST['Fname']?><br />; <?php $jersey = $_POST['Jersey']?><br />; <?php $height = $_POST['Height']?><br />; <?php $weight = $_POST['Weight']?><br />; <?php $email = $_POST['Email']?><br />; <?php $update = mysql_query(UPDATE tblathletes SET strEMailAddress='$email' WHERE intAthleteID='$ID'); if (!$update) {header("location: sports-memberindex.php"); exit(); } die('Could not post your data: ' . mysql_error()); } mysql_close($con); ?> i hear what you're saying, but unfortunately I get the same result despite the change. the page processes to the header page, but the db does not reflect the update sent from my form. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 27, 2009 Share Posted May 27, 2009 mysql_query(UPDATE tblathletes SET strEMailAddress='$email' WHERE intAthleteID='$ID'); See anything wrong there? Your query should be in quotes. Quote Link to comment Share on other sites More sharing options...
karnegyhall Posted May 28, 2009 Author Share Posted May 28, 2009 still no dice after adding the quotes man. Quote Link to comment Share on other sites More sharing options...
corbin Posted May 28, 2009 Share Posted May 28, 2009 If you echo out the query (something very helpful to do when a query seems to be misbehaving), you might notice that $ID is not being put into the query correctly. You forgot session_start(). (Unless of course there is some circumstance about which I don't know.) Quote Link to comment Share on other sites More sharing options...
karnegyhall Posted May 28, 2009 Author Share Posted May 28, 2009 i appreciate that try man. but session start exists in my require once() function that is 'not' included in this code. echoing the code has been done many moons ago. Quote Link to comment Share on other sites More sharing options...
fenway Posted June 2, 2009 Share Posted June 2, 2009 echoing the code has been done many moons ago. Well, maybe "many moons ago" it didn't matter, but it does now -- echo the query and post the results here. 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.