Jump to content

MySql UPDATE Table...Warning.

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Guest_GerarD_91_*

Guest_GerarD_91_*
  • Guests
Hi again ppl... I come today with a little warning that's been taking all my day of work.
What i want to do is, read some info. from a DB, show them in a form, and be able to change some fields, like email, address, etc.
The problem is that i'm getting this:

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in D:\xampp\htdocs\workbench\Pagina\PetroAlianza\Modificar_Usuario.php on line 32.

But, the info. i want to change is saving succesfully, the problem seems to be the part when i check if the Update was done or not. Here is the piece of code:


if (isset($_POST['Save'])){

    $row=mysql_fetch_assoc(mysql_query("UPDATE informacion_general SET dir_habitacion='".$_POST['dir_habitacion']."' WHERE cedula='".$_POST['cedula']."'"));

    if("$row"){

      echo"\n\nAll cool with the Update";

    } else{

      echo"\n\nSomething is wrong here";

    }

}


Hope you guys can get with the problem, 'cuz i can't. xDDD... Thanks with all the help before btw, this is an excellent forum...

#2
Guest_GerarD_91_*

Guest_GerarD_91_*
  • Guests
Hahaha i came with the solution.. xDD.. I'm so a "copy&paste guy", that copy this

mysql_fetch_assoc()


in the update query... Now it's all working just fine...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users