Forum Moderators: coopster
I placed the code in WebCoder and still couldn't find the error. I know it will be easy for you alll to see.
I just get a bit frustrated from these kinds of "simplistic" errors.
Thanks,
Senmar
<?
include(?.php');
// Get some data from the table.
$query = "SELECT publication_name, publication_year, url FROM news_table WHERE publication_name='$publication_name', publication_year='$publication_year', url='$url'";
$result =@mysql_query($query) or die ('Could not execute query.');
echo "<table border=1>";
echo "<tr><th>Publication Name</th><th>Publication Year</th><th>Volume Number</th><th>URL</th></tr>";
while($row = mysql_fetch_array($result))
{
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['publication_name'];
echo "</td><td>";
echo $row['publication_year'];
echo "</td><td>";
echo $row['volume_number'];
echo "</td><td>";
echo $row['url'];
echo "</td></tr>";
echo "</table>";
}
?>
<html>
<form method="post" name="Publications" action="srch.php">
<table><tr>
<td>Publication Name:</td>
<td><input type="text" name="publication_name" size="40" maxlength="45"></td>
</tr><tr>
<td>Publication Year:</td>
<td><input type="text" name="publication_year" size="4" maxlength="4"></td>
</tr><tr>
<td>Volume Number:</td>
<td><input type="text" name="volume_number size="4" maxlength="5"></td>
</tr><tr>
<td>URL:</td>
<td><input type="text" name="url" size="60" maxlength="65"></td>
</tr>
<tr><td colspan="2" align="center">
<input type="submit" name="Publications" value="Search Database">
<input type="reset" name="reset" value="Reset"></td>
</tr></table>
</form>
</html>
$query = "SELECT publication_name, publication_year, url FROM news_table WHERE publication_name='$publication_name', publication_year='$publication_year', url='$url'";echo $query."<br>";
$result =@mysql_query($query) or die (mysql_errno().": ".mysql_error()."<br>");
It's probably something like a ' in one of your variables that's making it choke.
Tim