I have an alphabet listing in one page. If I click one alphabet I am able to display the list of authrs using the code below. But Can some bodyhelp to retain the rest of the HTML page as such and format the result by inserting in a table ?
<?php
/ Connecting, selecting database /
$link = mysql_connect ("localhost", "database", "password") or die ('I cannot
connect to the database because: ' . mysql_error());
print "Connected successfully";
mysql_select_db("morete5_quotes") or die("Could not select database");
$sor = $_GET['by'];
print "before";
echo $sor;
print "after";
/* Performing SQL query */
$query = "SELECT DISTINCT Author FROM Quotes WHERE Author LIKE '$sor%'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
/* Printing results in HTML */
print "<table>\n";
<TABLE style="WIDTH: 79.69%; HEIGHT: 87px" border=1>
<TBODY>
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
print "\t<th>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</th>\n";
print "\t</tr>\n";
}
print "</table>\n";
/* Free resultset */
mysql_free_result($result);
/* Closing connection */
mysql_close($link);
?>[/SIZE]
Also It would be helpful if somebody could tell me where I can get tutorials for integrating PHP with HTML and for formatting the output of a query and displaying it...