This is my code and the error is underneath.
<?
$search = $_POST["search"];
$db = "`char`";
$connection = mysql_connect("localhost","wowbasec","PASSWORD REMOVED");
mysql_select_db("wowbasec_class", $connection);
$query = "select * from characters, location WHERE name='$search'";
$result = mysql_query($query, $connection);
if (!$result) {
echo 'Invalid query: ' . mysql_error(). "<br>";
echo 'SQL Query: ' . $query. "<br>";
die();
}
while ($r = mysql_fetch_assoc($result)) { // Begin while
$ts = $r["name"];
$ts1 = $r["id"];
?>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="view.php?id=<?php echo $ts1['id'];
$ts1 = $_POST['id']; ?>"> <? echo $ts ?></td>
</tr>
</table>
<?
}
?>
Invalid query: Column 'name' in where clause is ambiguous
SQL Query: select * from characters, location WHERE name='Harry'