I use this to add a new row of data to a table:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>$query = "insert into $parent values('$id','$author','$website','$fname','$width','$place','$title')";
$result = mysql_query($query) or die("crap");[/code]
The $id is an auto incrementing field so every row can be referenced with a unique number. Suppose I have the $id of the row I want to modify, and I have new values for $author, $website, $fname, $width, $place, and $title. What code do I use to modify the row (keeping the same $id)?
[This message has been edited by scream (edited July 07, 2000).]
You can do one of two things. You can use replace:
$query="replace into $parent values($id,'$author','.... etc
which will match where ANY field is a unique index (which auto_increment columns qualify for) or you can use update:
$query="update $parent set author='$author',website='$website' ... etc... where id=$id";
assuming column names there.
Thanks for the reply Rod. That did the trick!