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 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. 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. 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
Archived
This topic is now archived and is closed to further replies.