EDIT: I HAVE RESOLVED THIS ISSUE. Everything was going well with my new project untill now. I have desperately tried to resolve an issue I have with my SQL insertions with PHP. Heres the part with an error $sql = "SELECT `highscore` FROM `games` WHERE `gameid`='" . $game_id . "';"; $query = mysql_query($sql); if (mysql_num_rows($query)) { $row = mysql_fetch_array($query); echo $row["highscore"]; // This line is just for debugging purposes if ($thescore > $row['highscore']) { mysql_query("UPDATE `games` SET `highscore`='" . $thescore. "' WHERE `gameid`='" . $game_id . "';"); } mysql_query("UPDATE `games` SET `plays` = `plays` +1 WHERE `gameid`='" . $game_id . "';"); } PHP: The echo on line 6 fails, (but right up untill the mysql_fetch_array() works fine, I have proved it by echoing all previous values...) So basically, I've located the error to be from the line: $row = mysql_fetch_array($query);, and thus deeming the 3 lines after; useless. Can anyone see where I've gone wrong? by the way, $thescore and $game_id are definitely defined and working.. the echo is the first and only echo I tested which fails to echo anything... This is definitely an error in my coding... All the right sql fields to allow the script to work are there, etc.. Thanks a lot Chuckun EDIT: I HAVE RESOLVED THIS ISSUE.
I think you should remove the semicolons from the end of MySQL queries, and also replace `plays` = `plays` +1 by $plays++
I took a completely different approach, it's all good thanks for the advice though, appreciated either way
Another time, use mysql_error(); after your query... It does often give you a clue on what you've made wrong. mysql_query(......)or die(mysql_error());