|
Posted by Ian Davies on 10/26/05 21:16
I have the following code which displays some some formatted text in my
browser. The problem is I need to create a text file and write the records
from this array into it. Does anyone know how to acheive this.
Thanks in advance
Ian
$query="select * from Questions";
$rt=mysql_query($query);
echo mysql_error();
while($nt=mysql_fetch_array($rt)){
echo "INSERT INTO tQuestions VALUES ("."$nt[QuestionNo]".",
"."$nt[TypeID]".", "."$nt[NCIndex]".", '"."$nt[Question]"."',
'"."$nt[Optiona]"."', '"."$nt[Optionb]"."', '"."$nt[Optionc]"."',
'"."$nt[Optiond]"."', '"."$nt[Optiond]"."', '"."$nt[Optione]"."',
'"."$nt[ImagePath]"."', '"."$nt[answer]"."', '"."$nt[answer2]"."',
'"."$nt[answer3]"."', '". "$nt[answer3]"."', '". "$nt[answer4]"."', '".
"$nt[answer5]"."', '". "$nt[answer6]"."', '". "$nt[answer7]"."', '".
"$nt[answer8]"."', '". "$nt[answer9]"."', '". "$nt[answer10]"."', ".
"$nt[AnsPerQuest]".')<br>';
}
Navigation:
[Reply to this message]
|