LostKID Posted September 15, 2009 Share Posted September 15, 2009 im having problem trying to update a bunch of information. how can i do this all in one go? im currently using: <?php include("connect.php"); // CALL IN VARIABLES $fname = strip_tags(mysql_real_escape_string($_POST['fname'])); $lname = strip_tags(mysql_real_escape_string($_POST['lname'])); $gamert = strip_tags(mysql_real_escape_string($_POST['gamert'])); $youtube = strip_tags(mysql_real_escape_string($_POST['youtube'])); $web = strip_tags(mysql_real_escape_string($_POST['web'])); $bio = strip_tags(mysql_real_escape_string($_POST['bio'])); // THE QUERY $query5 = "UPDATE user SET fname = '$fname', lname = '$lname', gamert = '$gamert', youtube = '$youtube', web = '$web', bio = '$bio' WHERE email='{$_SESSION['email']}'"; $result5 = mysql_query($query5) or die ("error editing information"); if($result5){ echo "information Successfully changed"; print "<meta http-equiv=\"refresh\" content=\"0;URL=page.php?id=$id\">"; } ?> but it doesnt seem to be working.. Quote Link to comment https://forums.phpfreaks.com/topic/174374-solved-update-mysql/ Share on other sites More sharing options...
MadTechie Posted September 15, 2009 Share Posted September 15, 2009 replace die ("error editing information"); with die (mysql_error()); and define what you mean by it doesnt seem to be working.. Quote Link to comment https://forums.phpfreaks.com/topic/174374-solved-update-mysql/#findComment-919182 Share on other sites More sharing options...
LostKID Posted September 15, 2009 Author Share Posted September 15, 2009 sorry im such a twit im so lost in my ways i forgot to explain the situation. okay so basically im building an edit information page. the page is submitted and then it goes to edit_process.php. then it uses the code before. i dont get any errors just a success echo. i check the fields and it doesnt seem to have updated the fields in mysql. is there a certain way to bulk UPDATE in a query or is the way i done it correct? Quote Link to comment https://forums.phpfreaks.com/topic/174374-solved-update-mysql/#findComment-919189 Share on other sites More sharing options...
MadTechie Posted September 15, 2009 Share Posted September 15, 2009 I don't know what you mean by bulk ! if you mean many different queries at once then MySQLI could do it, Looking back on your code the one thing i would suggest is you echo the query on the success, as i believe your WHERE email='{$_SESSION['email']}' would become WHERE email='' as i seen no session_start(); in your script Quote Link to comment https://forums.phpfreaks.com/topic/174374-solved-update-mysql/#findComment-919194 Share on other sites More sharing options...
LostKID Posted September 15, 2009 Author Share Posted September 15, 2009 perfect thanks! Quote Link to comment https://forums.phpfreaks.com/topic/174374-solved-update-mysql/#findComment-919222 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.