I have been using MySQL in conjunction with PHP for many years now...
I have been using the exact same method for not only connecting to a
database and performing the queries but also displaying the results.
I've been told numerous times that my methods are out-dated. I'm more
than willing to cede to this possibility but I need help getting out
of the rut!!! Can anyone help me?
Here are some examples:
<head>
....
<?php include "../../../_private/mysql.inc"; ?>
<?php $db = mysql_connect("$server","$user","$pass"); ?>
....
</head>
<body>
....
<?php
mysql_select_db("database_name",$db);
$result = mysql_query("SELECT * FROM temple_items",$db);
while ($myrow = mysql_fetch_array($result)) {
$id = $myrow["ID"];
$name = $myrow["Name"];
$amount = $myrow["Amount"];
$date = $myrow["Date"];
echo "<div>" . $name . ": " . $amount . " (" . $date . ")</div><br
/>";
}
?>
....
</body>
It's crap, I know... I've been told that there are more efficient ways
of doing nearly all of this. Can someone instruct me in the ways of
better database queries? I'm hopeless until I have this knowledge. ;)
Thanks beyond words in advance.