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

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

A little help needed passing hidden values to next page
I have a page that has hidden values in a form.

example
Code: <input name='signupID

PHP page loading in Firefox but not in IE
hello,

i am currently doing a project in PHP and i have a problem. If I view the project in M

Deleted Delivery but material wont return
We deleted a delivery but the material its still pending.

We made a reverse goods movemen

Checking if field is empty AND using !is_numeric
Hi lads,

Need to be able to display an error message (using isset?) that says "Cant lea

Passing an array of values From VB6.0 to Oracle PL/SQL Function
Basically we are using VB6.0.

When we try to pass an array from VB6.0 to an Oracle PL/SQL

weeks in a year
hi,

i found this snippet on php.net
QuoteFor the week number for weeks starting on Sunday:

please, need help coding this voting for your favorite car polling system.
hi, my code needs a lot of work, but i want to be able to let users vote on their favorite car, upda

losing variables between php brackets
Hi

have got this code:
Code: $id=mysql_result($result,0,"itemid");
$title=mys

Hashing?
Hi, I was hoping to take a string value then convert it - consistently - across each of our pages in

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