René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

select [MySQL and PHP]

This select uses the table from this insert example.
<?php

  require('conn_db.inc');

  $db_conn = connect_db();

  if ($db_conn) {

    $res = mysql_query('select i, t, b from table_ex');

    if (! $res) {
      printf('<b>Error with query</b>: %s', mysql_error());
      exit(0);
    }

    print "\n<table>";
    while ($row = mysql_fetch_array($res)) {
      print  ("<tr>");
      printf ("<td>i:</td><td>%d</td>", htmlspecialchars($row["i"]));
      printf ("<td>t:</td><td>%s</td>", htmlspecialchars($row["t"]));
      printf ("<td>b:</td><td>%s</td>", htmlspecialchars($row["b"]));
      print  ("</tr>\n");
    }
    print "</table>";
  }

?>