Zaidejas1324 Posted August 18, 2010 Share Posted August 18, 2010 Hi i got an error. I cant get $new_score and $new_played variables. $name = $_POST["name"]; $score = $_POST["score"]; $result = mysql_query("SELECT * FROM taure_lentele WHERE name='$name'"); $row = mysql_fetch_array($result); if(mysql_num_rows(mysql_query("SELECT name FROM taure_lentele WHERE name='$name'") ) == 1 ) { $old_score = $row['score']; $score + $old_score = $new_score; $old_played = $row['played']; $new_played = $old_played++; mysql_query("DELETE FROM taure_lentele WHERE name='$name'"); mysql_query("insert into `taure_lentele` set `name` = '$name', `score` = '$new_score', `played` = '$new_played"); } Link to comment https://forums.phpfreaks.com/topic/211115-cant-get-numbers-from-variables/ Share on other sites More sharing options...
Pikachu2000 Posted August 18, 2010 Share Posted August 18, 2010 $new_score = ($score + $old_score); AND $new_played = ($old_played + 1); // at least that's what it looks like you're trying to do . . . Link to comment https://forums.phpfreaks.com/topic/211115-cant-get-numbers-from-variables/#findComment-1100995 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.