| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Jul 2005 Location: Petaluma, California
Posts: 128
![]() | PHP/MySQL Questions Hi all, Im currently creating a website that is going to display credit cards by type, insurance and credit services. Each credit card, credit service or insurance listing is going to be in its own box with a small space between each one, each listing is to be created by the MySQL output loop. My questions are these: 1. Is there a way to tell the the MySQL output, to put something, like an advertisement from an affiliate between every 3rd or 4th listing? 2. For the area where im going to put APRs and other card properties, to make it easier to read, I would like to alternate what color the background is, is there a way I can tell the MySQL output, that I want entries with a certain fieldname to use "Div A" and other ones "Div B"? |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Montreal, Quebec, Canada
Posts: 324
![]() | You may want to use modulus (%) Example PHP Code:
Last edited by Noobie; 08-31-2006 at 09:21 AM.
|
| |
| | THREAD STARTER #3 (permalink) | ||||
| NamePros Member Join Date: Jul 2005 Location: Petaluma, California
Posts: 128
![]() |
Thanks Noobie... Just so I understand, since at the part where your echoing back the div, you have $line[0], how will that work with my output loop? Would having 0 in the array area cause problems? I dont understand how that works, and I am curious from a learning aspect... | ||||
| |