if print_r($row);after the first request you see something like:
Array
(
[0] => id
[1] => quote
[2] => aid
)
then in the second request you use $row[1]which is a quote (string), not a number.
$sql = mysql_query("SELECT * FROM author where aid = " . $row[1], $con);
if you repeat the error (using mysql_error($con)), you will see something:
SQL; , MySQL
mysql_fetch_row mysql_fetch_assoc, . , . .
<?php
$_GET['id'] = 1;
$DB_SERVER = "localhost";
$DB_USER = "root";
$DB_PASS = "";
$DB_NAME = "test";
$con = mysql_connect($DB_SERVER, $DB_USER, $DB_PASS);
mysql_select_db($DB_NAME);
$sql = mysql_query("SELECT * FROM quotes WHERE id = " . (int)$_GET['id'], $con);
if(!$sql) {
echo mysql_error($con);
}
$row = mysql_fetch_assoc($sql);
mysql_free_result($sql);
$sql = mysql_query("SELECT * FROM author where id = " . (int)$row['aid'], $con);
if(!$sql) {
echo mysql_error($con);
}
$row = mysql_fetch_assoc($sql);
mysql_free_result($sql);
print_r($row);
mysql_close($con);