The following code works when i run it in localhost, but when I host it online, it gives an error.
if(isset($_POST['congressman'])){
$congressman = $_POST['congressman'];
$no_of_votes = mysql_result(mysql_query("SELECT no_of_votes FROM `tbcandidates` WHERE `identification_no`=$congressman"),0) + 1;
$query=mysql_query("UPDATE tbcandidates SET no_of_votes = '$no_of_votes' WHERE identification_no = $congressman");
This line:
no_of_votes = mysql_result(mysql_query("SELECT no_of_votes FROM `tbcandidates` WHERE `identification_no`=$congressman"),0) + 1;
It says mysql_result(): supplied argument is not a valid MySQL result resource in etc..
try to add
ob_start()at the top of the code andob_flush()at end