vendredi 28 mars 2014

What's wrong with this update query?


Vote count:

0




I'm trying to make a form in a website where you can write the name, price or image of the product you want to update and in the textbox next to every field you can write the new value you want it to take but idk why everytime I write something the only field that updates is the name and instead of change the former name for the new one it change to 0, the php code I'm using is this:



<?php

mysql_connect("localhost","paradise_root","gantzminus1");
mysql_select_db("paradise_dbsalon");
$nombre = $_POST['txtnombre'];
$precio = $_POST['txtprecio'];
$imagen = $_POST['txtimagen'];
$nombre2 = $_POST['txtnombre2'];
$precio2 = $_POST['txtprecio2'];
$imagen2 = $_POST['txtimagen2'];

$_GUARDAR_SQL = "update productosyservicios set nombre = ('".$nombre2."') or precio = ('".$precio2."') or imagen = ('".$imagen2."') where nombre = ('".$nombre."') or precio= ('".$precio."') or imagen = ('".$imagen."') ";

$rst = mysql_query($_GUARDAR_SQL) or die("error".$_GUARDAR_SQL);
if($rst==true){
$rest=false;

}
?>


asked 3 mins ago






Aucun commentaire:

Enregistrer un commentaire