Hi ,
I am trying to excute one query while clicking on an alphabet in the alphabet listing.The result(author listing with that alphabet) is again displayed as hyperlink to another page where the books will be displayed by that author. I have written the following code, but keeping on getting errros. Expecting some help.....
<?php
/ Connecting, selecting database /
$link = mysql_connect ("localhost", "database", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db("morete5_quotes") or die("Could not select database");
$sor = $_GET['by'];
/* 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";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
echo "<a href='http://www.mysite.com/Author_A1.php?by=".$col_value"'">$col_value</a>
}
print "\t</tr>\n";
}
print "</table>\n";
/* Free resultset */
mysql_free_result($result);
/* Closing connection */
mysql_close($link);
?>