I've been pulling stuff from my dbs usually using some combination of
$query = "select statements here";
$result = mysql_db_query('db', $query);
if ($result) {
while ($r = mysql_fetch_array($result)) {
$variable = $r["fieldname of db field"];
$variable2= $r["fieldname of db field"];
echo "some stuff";
}
else {
echo "some other stuff";
}
mysql_free_result($result);
And that combo has worked well for me. But now I'm trying to do a pretty huge dump of a db that has hundreds of fields and I don't want to have to specify each one. So what I'm wondering is if there is an easy, straightforward way to tell PHP "Hey, for each field in a row you find, put quotes around it and a comma to seperate it from the next field, and when you get to the end of a row, newline it, and keep doing that til there are no rows left", because that would make my life very much easier than having to specify each and every field.
(I know the query it's building is correct because I've been echoing $query and then cutting and pasting it directly into mysql to see if the select statements this particular script is building are valid. they are, btw)