Odd or Even


Posted on 16th Feb 2014 07:03 pm by admin

Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for the sake off css) I need to distinguish between odd and even row numbers.

Code:
<?
connect();

$documentQ=mysql_query("select * from docs");
while($doc=mysql_fetch_assoc($documentQ))
{
echo"
<li class="oddrow"><a href="docs/notes/PrincipalsNotes_0911.doc">November</a></li>
<li><a href="docs/notes/PrincipalsNotes_0910.doc">October</a></li>
<li class="oddrow"><a href="docs/notes/PrincipalsNotes_0909.doc">September</a></li>
";
}

free($documentQ);

?>



Male sence?

Any thoughts?

No comments posted yet

Your Answer:

Login to answer
152 Like 29 Dislike
Previous forums Next forums
Other forums

Include a php
Hello,

I'm trying to include a function that shows the recent searches.
Example I have <

list files from folder, only one for each date
I have many files in a folder and wish to only list one of each date

these are the file names

Generating unique numbers using php
Hi,
I need help in generating unique number using php.I tired using rand() in php.But, by using r

need Array help
This is what I have to do.
$teamname[1] = "Red Sox"
$teamname[2] = "Gian

Search function
I am looking for some guidance from the experts.

I am trying to create a search function. It

question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.

I hav

Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.
It'll do the query and then do..

Need a fuction to count entries in a field
Hi
I need a fuction to count how many times a email address is entered in to a field.

I ma

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

webpage with (simple) login & mysql-db
Hi all,

What I was looking for before was a multi-user password manager, web-based! The offer

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash