Php > Look and Feel
Alternating Row Colors
Alternating Row Colors
Alternating Row Colors
// Connect to MySQL mysql_connect ('localhost', 'username', 'password') or die ("Can't connet to MySQL server."); mysql_select_db ('dbname'); $result = mysql_query (SELECT * FROM table); if ($row = mysql_fetch_array($result)) { for ($i = 0; i < count($row); $i++) { // Set Table Row Color if ($i % 2) { echo "
"; } else { echo "
"; } // Now display our table cell info ?>
echo $row["whatever"]; ?>
} else { echo "
Sorry, no records were found!
"; } ?>
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