Ok. So first thing, in PHP : use PDO. Nothing less.
Something like that :
Code:
<?php
// Change these vars with your server infos
$DB_HOST = 'yourDbHost';
$DB_NAME = 'yourDatabaseName';
$DB_USER = 'user';
$DB_PASS = 'pass';

try{
  // Instanciate a PDO object
  $db = new PDO('mysql:dbname='.$DB_NAME.';host='.$DB_HOST);
  // Get a PDO statement
  $stmt = $db->prepare('your SQL query here');
  // Fetch all results, may be bad if there's a shitload of data
  $data = $stmt->fetchAll();
}
catch(PDOException $e){
  echo 'PDO error';
  die();
}
catch(Exception $e){
  echo 'ouch';
  die(); // That's bad, I know
}
// You should write a proper exception handler which will log all the errors into a file
// We start outputting html here, you better put the html part in a different file which you'll include
?>
<table>
<?php foreach($data AS $tuple){ ?>
  <tr>
    <td><?=$tuple['column1']?></td>
    <!-- Add more column if needed -->
  </tr>
<?php }?>
<table>


Last edited by Arkh; 06/25/09 12:00 PM.

[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]