Sooth Posted August 28, 2007 Share Posted August 28, 2007 What's wrong with this script. It doesn't update as required. include "config.php"; mysql_connect($db_hostname,$db_username,$db_password); @mysql_select_db($db_database)or die("<p>Unable to select database.</p>"); $query="UPDATE users SET email='$_POST[update_email]', firstname='$_POST[update_firstname]', lastname='$_POST[update_lastname]', birthday='$_POST[update_birthday]', birthmonth='$_POST[update_birthmonth]', birthyear='$_POST[update_birthyear]', genre='$_POST[update_genre]', nationality='$_POST[update_nationality]', config='$_POST[update_config]' WHERE username='$_SESSION[username]'"; mysql_query($query); mysql_close(); Link to comment https://forums.phpfreaks.com/topic/67033-query/ Share on other sites More sharing options...
AndyB Posted August 28, 2007 Share Posted August 28, 2007 session_start() is missing. after defining $query in your script, echo $query to see exactly what the query looks like. Link to comment https://forums.phpfreaks.com/topic/67033-query/#findComment-336158 Share on other sites More sharing options...
Sooth Posted August 28, 2007 Author Share Posted August 28, 2007 I have session_start(); and the query looks alright when I echo it. But it's not chaning the database. Link to comment https://forums.phpfreaks.com/topic/67033-query/#findComment-336186 Share on other sites More sharing options...
AndyB Posted August 28, 2007 Share Posted August 28, 2007 Try pasting the echo'd query into the SQL query box in phpMyAdmin (if you have that installed) and see what happens. Link to comment https://forums.phpfreaks.com/topic/67033-query/#findComment-336199 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.