Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--CSS-->
- <style type="text/css">
- body{ background-color: #151515; font-family: tahoma; }
- .td_1 { background-color: #efefef; }
- .td_2 { background-color: #fff; }
- .td_top { background-color: #000; color: #fff; min-width: 30px; }
- .tabulka { margin-top: 150px; margin-left: 150px; }
- </style>
- <?php
- $dbhost = 'localhost';
- $dbuser = 'root';
- $dbpass = '';
- $dbname = 'test';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass)
- or die ('Error connecting to mysql');
- $selected = mysql_select_db($dbname, $conn);
- /*$selected = mysql_select_db($dbname);*/
- $result = mysql_query("
- SELECT
- *
- FROM
- `customers`
- ");
- /*if echo mysql_num_rows($result)
- {
- $result = 0;
- echo gfdsgdfshfhf
- }
- */
- echo"<table class='tabulka' cellpadding=5 cellspacing=1>
- <tr>
- <th class='td_top'>ID</th>
- <th class='td_top'>Meno</th>
- <th class='td_top'>Priezvisko</th>
- <th class='td_top'>Tel. Cislo</th>
- <th class='td_top'>Poznamka</th>
- </tr>";
- $i = 1;
- While ($arr = mysql_fetch_assoc($result))
- {
- $pom = $i%2+1;
- echo"<tr>
- <td class='td_" .$pom . "'>" . $arr['id'] . "</td>
- <td class='td_" .$pom . "'>" . $arr['name'] . "</td>
- <td class='td_" .$pom . "'>" . $arr['surname'] . "</td>
- <td class='td_" .$pom . "'>" . $arr['phone'] . "</td>
- <td class='td_" .$pom . "'>" . $arr['note'] . "</td>
- </tr>";
- $i++;
- } // end while..
- echo"</table>";
- mysql_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement