mysql - PHP Update Table Error -


i've developed code update field in mysql database it's not working @ all. here code:

$note = mysqli_real_escape_string($con, $_request["note"]);  $read_note_sql = "update notes set read = 'y' id = '$note'"; $read_note_res = mysqli_query($con, $read_note_sql) or die(mysqli_error());  if(mysqli_affected_rows($con)>0){      echo "1"; } else {     echo "0"; } 

this echoing 0 , showing error "mysqli_error() expects 1 parameter, 0 given in"

can please advise solution here? thanks

see if works:

$note = mysqli_real_escape_string($con, $_request['note']); $read_note_sql = "update notes set read = 'y' id = '$note'"; if (!mysqli_query($con, $read_note_sql)) {     printf("errormessage: %s\n", mysqli_error($con)); } else {     // printf("affected rows (update): %d\n", mysqli_affected_rows($con));      if(mysqli_affected_rows($con)>0){         echo "1";     }     else     {         echo "0";     } } 

Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -