i want to get the result of mysql query into a text, currently it works when i type mysql_num_fields and mysql_num_rows, but it does not work mysql_fetch_array or mysql_fetch_assoc which is the genuine requirement.. can anybody kindly tell me what wrong with this code
$query = "CALL create_report($ID, '$startDate', '$endDate', $endlmt, $position);";
$Localcon = $this->getConnection();
$result = mysql_query($query, $Localcon);
//$debug = mysql_num_rows($result);
$myFile = "debug.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "-------------\n";
fwrite($fh, $stringData);
$stringData = mysql_fetch_array($result);
fwrite($fh, $stringData);
fclose($fh);
edited code
$stringData_2 = mysql_fetch_array($result);
foreach ($stringData_2 as $string) {
$stringData = "----------------\n";
fwrite($fh, $stringData);
fwrite($fh, $string);
}