Re: [PHP] Counting Occurrences within an If statement
- From: micah@xxxxxxxxxxx (Micah Gersten)
- Date: Sun, 20 Jul 2008 19:44:05 -0500
If it's a simple x < y, you might want to consider putting your if
statement in the SQL query so you don't return so many rows. To make a
counter, just set a variable like:
$counter = 0;
if ($x <$y)
{
print $row;
$counter++
}
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Mark Bomgardner wrote:
I have been working on the something for the last day and can't figure it.
out.
I am pulling 7500 rows from a MySQL database, but I only want to display a
certain numbers of rows based up an if statement. I want to count the rows
within the if statement.
mysql query result
if(x < y){
display a row in a table
}else{
Don't display anything
}
Every time a row is displayed, I want to add one to a counter
markb
- References:
- Counting Occurrences within an If statement
- From: "Mark Bomgardner"
- Counting Occurrences within an If statement
- Prev by Date: Counting Occurrences within an If statement
- Next by Date: Pasword Protecting several pages
- Previous by thread: Counting Occurrences within an If statement
- Next by thread: Pasword Protecting several pages
- Index(es):
Relevant Pages
|
|