Alicia Posted September 8, 2012 Share Posted September 8, 2012 Hi, Can anyone give me an idea whats wrong with this query? from the while loop, I can echo all the values echo below but why my query just won't update the database records? since all values are there? echo "Updated".$row['team_id'].'-'.$row['UserName'].'-'.$row['Password']."<br>"; $upd = mysql_query("UPDATE `team` SET `username2` = '{$_row['UserName']}',`password2` = '{$_row['Password']}' WHERE `team`.`team_id` ='{$row['team_id']}'") or die(mysql_error()); echo mysql_affected_rows(); what i take the query and update directly in mysql console, it works e.g : UPDATE `team` SET `username2` = 'miko',`password2` = 'ERQSDs' WHERE `team`.`team_id` ='1232' Please advise and thanks Quote Link to comment https://forums.phpfreaks.com/topic/268159-not-able-to-trace-prob/ Share on other sites More sharing options...
Jessica Posted September 8, 2012 Share Posted September 8, 2012 You're echo'ing $row, but using $_row. Quote Link to comment https://forums.phpfreaks.com/topic/268159-not-able-to-trace-prob/#findComment-1376330 Share on other sites More sharing options...
Alicia Posted September 8, 2012 Author Share Posted September 8, 2012 oh gosh, i am such an idiot.. thank you very much for your hint. Quote Link to comment https://forums.phpfreaks.com/topic/268159-not-able-to-trace-prob/#findComment-1376332 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.