Alright I have a query and some code to write to a text file:
Is it posible to have say开发者_StackOverflow社区 another $query2 and insert that into the same rows as well? If not, how would I go about it.?
so you're trying to insert the results from two queries into the same text file? do the queries return result sets that correspond to each other in some way? If so, then just assign the results of each query to an array and then when you write out to the file, use a foeach on the array.
For example, assuming that both queries return data that can be joined on the card.id field:
while ($row = mysql_fetch_assoc($query1Result)) {
$resultArray1[] = $row;
}
while ($row = mysql_fetch_assoc($query2Result)) {
$resultArray2[] = $row;
}
foreach ($resultArray1[] as $key=>$result) {
File stuff here. Use $result as an assoc array from query1 and $resultArray2[$id] as an assoc array from query2.
}
精彩评论