Page 1 of 1

Value replacement

Posted: Mon Jun 28, 2004 7:20 pm
by XxLaSeRxX
Im having a little problem replacing specific values. Im using the REPLACE command but I cant use the WHERE clause. Im not sure how to tell which col and which row to replace the specific value in.. Unless Im not supposed to use the REPLACE command and are supposed to use something else. I tried googling replacing values in a mysql database and thats what I got..


Thanks in advance.

Posted: Mon Jun 28, 2004 7:54 pm
by tim
use UPDATE

ie:


Code: Select all

<?php
$sql = "UPDATE table_name SET field_name='$var' WHERE cond=cond";
mysql_query($sql);
?>