mysql ... adding a field on update query ...
Posted: Tue Mar 30, 2010 2:56 pm
Hello:
Okay, there has to be a simple answer that is beyond me on this. During an UPDATE, I would like to add a variable to a field. In example here, simply add the variable $varpepe101 to the contents of field pepe_99. Everything is and will be characters, this is not numeric in any way. Can someone show me where I am making my mistake please.
// Assign table to variable.
$varpepe101 = "P";
//
//
// Insert data from table where row that match this passkey.
$sql = mysql_query("UPDATE tblPepe SET pepe_99 = pepe_99.$varpepe101 WHERE tblPepe11 = 'ABC'");
Okay, there has to be a simple answer that is beyond me on this. During an UPDATE, I would like to add a variable to a field. In example here, simply add the variable $varpepe101 to the contents of field pepe_99. Everything is and will be characters, this is not numeric in any way. Can someone show me where I am making my mistake please.
// Assign table to variable.
$varpepe101 = "P";
//
//
// Insert data from table where row that match this passkey.
$sql = mysql_query("UPDATE tblPepe SET pepe_99 = pepe_99.$varpepe101 WHERE tblPepe11 = 'ABC'");