fetch then put record?
| From: | Steve B. | Date: | Tue, 10 Jun 2003 00:13:37 +0000 |
| Subject: | fetch then put record? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150831@lists.php.net to get a copy of this message | ||
Hello,
In ASP you can set records fields then call a dbupdate function.
It appears mysql only supports update with the UPDATE query?
Here is my code:
<?
$sql="SELECT * FROM lsm where ID = ".$HTTP_GET_VARS["ID"];
$result=query($sql);
if (!$result) die('sql error');
$dbrec=getrec($result);
if ($dbrec)
{
$dbrec["Complexname"]=$HTTP_POST_VARS["Complexname"];
$dbrec["Subdivision"]=$HTTP_POST_VARS["Subdivision"];
$dbrec["Beds"]=$HTTP_POST_VARS["Beds"];
$dbrec["BathsTotal"]=$HTTP_POST_VARS["BathsTotal"];
if ($HTTP_POST_VARS["SqFtTotal"]!="")
$dbrec["SqFtTotal"]=$HTTP_POST_VARS["SqFtTotal"];
$dbrec["ListPriceLow"]=$HTTP_POST_VARS["ListPriceLow"];
$dbrec["Streetnum"]=$HTTP_POST_VARS["Streetnum"];
$dbrec["Streetname"]=$HTTP_POST_VARS["Streetname"];
dbrec.update();
}
?>
How would you do a dbrec.update (which updates just the row you changed with the variables)
thanks
Steve
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com