well a small hiccup in thel ast few days. Although the solution has been got but being a very crude one i thought i might try this forum.
$row=mysql_fetch_array($result);
for {$index=0;$index<count($row);$index++){
print $row[$index];
print mysql_field_name($result,$index);
}
The above code will print out the array values and the corresponding field names of the database for each value.
What i would like to do is to convert the field names to variables and assign them to the appropriate values.
somnething like
"$".mysql_field_name($result,$index)=$row[$index];
now i know i cannot do that..but if i wanted ot do that how would i go about doign it ?
i have solved it by welll
$fname=$row[fname]
now the only problem with that is that what if i add new fields to the query then it my be a problem to keep writing the $fieldname=$row[fieldname];
any ideas or clues?
thanks
apoorva m.