Ed,
Neither of these are simple questions. Here's a snip of code from a VERY simple page I did that pulls a record out of a database and displays it.
<?PHP
// Make database connection
$dbcon = mysql_pconnect ($serverName,$userName,$userPassword) or die('Cannot connect to the server');
mysql_select_db ($databaseName,$dbcon) or die('Cannot connect to the database');
$poemArray = Array();
$sqlStatement = 'Select * from poem where poemID = '.$poemID;
// retrieve poem
$x=mysql_query($sqlStatement,$dbcon) or die('error in the query');
$poemArray = mysql_fetch_array($x,MYSQL_ASSOC);
// display.
?>
<pre><?echo stripslashes($poemArray['poem']);?></pre>
Now this is a VERY simple page. It only retrieves one row and displays the contents of one field but you can use it to get a feel for what is necessary.
Cal Evans
- Senior Internet Dreamer
- Techno-Mage
- Last of the great Internet Burma-Shave poets.
http://www.calevans.com
*