Hi,
Okay, if I was to use the following:
How could I call this data in the 'load data' button effectively based on the code you have done for me?PHP Code:<textarea name="comments" rows="20" cols="150" wrap="physical"><?php
$sql = mysql_query(" SELECT * FROM table");
$f = 0; //for showing the fields.
while($arr = mysql_fetch_array($sql)){
if($f == 0){
$f++; //this is so we never show the fields again
//dump fields
$rl = 0; //just to make a separator
$j = 1; //field count
foreach($arr as $key => $value){
$j++;
if($j % 2){ //mysql will give us numeric and text values as keys, we want to skip numeric
$rl += strlen($key);
echo strtoupper($key) . "\t";
}
}
echo "\n" . str_repeat("-", $rl) . "\n"; //this is the separator
}
$i = 1;
foreach($arr as $key => $value){
$i++;
if($i % 2){ //again, skipping numeric field values
echo $value . "\t";
}
}
echo "\n";
}
?></textarea>
<br />
<INPUT TYPE="submit" value="load data">
<INPUT TYPE="submit" value="export data" />
Thanks




Reply With Quote