Php > Look and Feel
Alternate Row Colours
Alternate Row Colours // Header rows print (""); print ("
Name
Email
"); // DB connection information $connection = mysql_connect("localhost","username","password"); $db = mysql_select_db("database", $connection); // SQL Query $sql = mysql_query("SELECT * FROM table"); $alternate = "2"; // number of alternating rows while ($row = mysql_fetch_array($sql)) { $name = $row["name"]; //name of field $email = $row["email"]; if ($alternate == "1") { $colour = "#000000"; $alternate = "2"; } else { $colour = "#464646"; $alternate = "1"; } print ("
$name
$email
"); } print ("
"); ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage