I have created a question Here That I think is a little bloated. To skim down this question here is my requirements:
I need to create 3 mySQL queries that grab all information in that row so that I can format the information into one of HTML tables.
Here is the query that I have which selects everything:
$qry_questions = mysql_query("SELECT * FROM mbr_qa_questions ORDER BY q_votes DESC);
while($row = mysql_fetch_array($qry_questions){
//Grab all information
}
Now, I need to make three queries that act like the one above, but I need it to do something like this:
pull everything from every third row in a table starting at row #1
pull everything from every third row in a table starting at row #2
pull everything from every third row in a table starting at row #3
Then I would put each of those queries into one of the 3 columns.
I can not do this by unique ID. Yes, it is an auto incrementing ID, but it will be probable that I might have to move whole rows into another table.
EDIT: I've added my attempt to count each row and place the queried result into the right "bin"
//GIVE EACH ENTRY A COLUMN NUMBER
$count++;
if($count >= 4){
$count = 1;
}?>
<div class="col" id="col-1">
<?PHP
while($count == 1){
include("pieces/answers/newAnswerLayout.php");
}
?>
</div>
<div class="col" id="col-2">
<?PHP
while($count == 2){
include("pieces/answers/newAnswerLayout.php");
}
?>
</div>
<div class="col" id="col-3">
<?PHP
while($count == 3){
include("pieces/answers/newAnswerLayout.php");
}
?>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…