Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $user;
- echo "This is page 1. You are $user->name.<br />";
- // Connecting, selecting database
- db_set_active('test');
- // Performing SQL query
- $query = 'SELECT id, product_name, created_at, updated_at FROM cims_build ORDER BY created_at DESC LIMIT 10';
- $result = mysql_query($query) or die('Query failed: ' . mysql_error());
- // Printing results in HTML
- echo "<table>\n";
- while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
- echo "\t<tr>\n";
- foreach ($line as $col_value) {
- echo "\t\t<td>$col_value</td>\n";
- }
- echo "\t</tr>\n";
- }
- echo "</table>\n";
- // Free resultset
- mysql_free_result($result);
- db_set_active('default');
Add Comment
Please, Sign In to add comment