> Does anybody know of a SELECT QUERY that will select every
> other record of a
> table ? I want to do this so that I can display my products
> in 2 columns (I
> will also be using arrays of course).
Don't know of a select that'll do it, but then I don't really understand
why you'd want to either.
(UNCHECKED psuedo code)
$query_result = mysql_query("whatever");
Check_that_you_got_a_result();
{
start_your_html_table_to_display_stuff();
start_first_row_of_table();
while(grab_a_row_from_query_result())
{
if (havent_started_first_column())
{
print_a_line_of_data();
close_first_column();
start_second_column();
} else {
print_a_line_of_data();
close_second_column();
close_table_row();
start_table_row();
}
}
if (still_in_first_column())
{
close_column();
}
close_table();
}
Well, something like that anyway - I haven't fully considered closing
off your rows and table properly but that's pretty much what I'd do to
make this work, and it still only needs one db query.
CYA, Dave
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php