i am trying to transfer data from one table to another for search index i wrote this code but only few data transfered rest not i can't find out what is the problem please help me code below:
include("./config.inc.php");
$db=connect_db();
$db_name=db_name();
$select_db=mysql_select_db($db_name,$db);
if(!$select_db)
{
print("$db_name not found");
exit();
}
$query="delete from search";
mysql_query($query);
$query_for_poem="select ID,Writer_name,Poem_title,Poem_content from poem";
$result_for_poem=mysql_query($query_for_poem);
while($row_for_poem=mysql_fetch_row($result_for_po
em))
{
PUTTING DATA INTO ARRAY
$ID_poem=$row_for_poem[0];
$Writer_name_poem=$row_for_poem[1];
$Poem_title=$row_for_poem[2];
$Poem_content=$row_for_poem[3];
$linkPoem="http://youthvox.com.np/poem/nextpoem.php?display=$ID_poem";
$query_poem_search="INSERT INTO search(url,name,description,title,type)values('$li
nkPoem','$Writer_name_poem','$Poem_content','$Poem
_title','Poem')";
$check1=mysql_query($query_poem_search);
if(!$check1){
print("Poem not ok<br>");}
}
$query_for_diary="select ID,Writer_name,Diary_title,Diary_content from diary";
$result_for_diary=mysql_query($query_for_diary,$db
);
while($row_for_diary=mysql_fetch_row($result_fo
r_diary))
{
PUTTING DATA INTO ARRAY
$ID_diary=$row_for_diary[0];
$Writer_name_diary=$row_for_diary[1];
$Diary_title=$row_for_diary[2];
$Diary_content=$row_for_diary[3];
$linkDiary="http://youthvox.com.np/diary/nextdiary.php?display=$ID_diary";
$query_diary_search="INSERT INTO search(url,name,description,title,type)values('$li
nkDiary','$Writer_name_diary','$Diary_content','$D
iary_title','Diary')";
$check2=mysql_query($query_diary_search);
if(!$check2){
print("D not ok<br>");}
}
$query_for_feature="select ID,Writer_name,Feature_title,Feature_content from feature";
$result_for_feature=mysql_query($query_for_feature
,$db);
while($row_for_feature=mysql_fetch_row($result_
for_feature))
{
PUTTING DATA INTO ARRAY
$ID_feature=$row_for_feature[0];
$Writer_name_feature=$row_for_feature[1];
$feature_title=$row_for_feature[2];
$feature_content=$row_for_feature[3];
$linkfeature="http://youthvox.com.np/featured/nextfeature.php?display=$ID_feature";
$query_feature_search="INSERT INTO search(url,name,description,title,type)values('$li
nkfeature','$Writer_name_feature','$feature_conten
t','$feature_title','Feature')";
$check3=mysql_query($query_feature_search);
if(!$check3){
print("F not ok<br>");}
}
$query_for_profile="Select ID,Profile_name,Profile_content from profile";
$result_for_profile=mysql_query($query_for_profile
,$db);
while($row_for_profile=mysql_fetch_row($result_for
_profile))
{
$ID_profile=$row_for_profile[0];
$Profile_name=$row_for_profile[1];
$Profile_content=$row_for_profile[2];
$linkProfile="http://youthvox.com.np/profiles/profile_next.php?display=$ID_profile";
//.print("$Profile_content<br>");
$query_profile_search="INSERT INTO search(url,name,description,title,type)values('$li
nkProfile','$Profile_name','$Profile_content','$Pr
ofile_name','Profile')";
$check4=mysql_query($query_profile_search);
if(!$check4){
print("P not ok<br>");}
}
?>