It does not work.... it just insert few records..and i have noticed that hadith field is giving problem.
Table Defination is : id(auto_increment),volume(varchar(30),book(varchar30),number(varchar40),hadith(Text)
So I just want to upate volume,book,number upating..
<?php
require_once("mainfile.php");
global $dbi;
echo " Testing ";
$result=mysql_query("SELECT volume,book,number,hadith from hadith ",$dbi);
while(list($volume,$book,$number,$hadith)=mysql_fetch_array($result)){
$hadith=str_replace("Narrated","Narrated ",$hadith);
$hadith = nl2br($hadith);
$number=preg_replace("([^0-9.])", "", $number);
$volume = preg_replace("([^0-9.])", "", $volume);
$book = preg_replace("([^0-9.])", "", $book);
echo" #Volume-$volume,Book-$book,Number-$number<p><b>$hadith</b><hr>";
#$hadithx=mysql_query("INSERT into hadithx(id,volume,book,number,hadith) values('','$volume','$book','$number','$hadith')");
$result=mysql_query("update hadithz set number='$number',volume='$volume', book='$book'", $dbi) or die ('Failed');
}
?>
it update but volume,number and book has same value 1 for 7000 rows ??? Also Error at line(13)
while(list($volume,$book,$number,$hadith)=mysql_fetch_array($result)){