Value replacement

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
XxLaSeRxX
Forum Newbie
Posts: 7
Joined: Sat Jun 19, 2004 8:24 pm

Value replacement

Post 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.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

use UPDATE

ie:


Code: Select all

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