Hi frnds,
i wud like to perform multiple updates in a single go in php.
i have put the update statement in a for loop.
but it gets executed only once.
the code for the updation is:
<?
require("util.php");
$sql=new MySQL_class;
$sql->Create("direcsol");
?>
<html>
<head>
<title></title>
</head>
<body>
<?php
$sql->Query("select * from idx_category_path");
for($i=0; $i<$sql->rows; $i++)
{
$sql->fetch($i);
$ifd=$sql->data["category_id"];
$pth=$sql->data["path_with_url"];
$fin=str_replace("-","/",$pth);
$pst=str_replace("browse/","",$fin);
$sql->query("update idx_category_path set path_with_url = '$pst' where category_id = '$ifd' ");
}
?>
</body>
</html>
"util.php" is a file which contains all the database connectivity functions.
is there any problem with the above mentioned code.
if there is one please suggest.
thanks in advance
Vijay Koul