[php]include ‘config.php’;
include ‘connect.php’;
$check = mysql_query("SELECT avatar FROM Users WHERE login = 'user'")
or die(mysql_error());
echo "<p>check: ";
echo $check;
echo "</p>";
$result = mysql_fetch_row($check);
echo "<p>result: ";
echo $result;
echo "</p>";
$result = $result[0];
echo "<p>finalResult: ";
echo $result;
echo "</p>";
mysql_close($con);[/php]
Output in browser looks lke that:
check: Resource id #5
result:
finalResult:
I tried fetch_assoc and fetch_array, but it seems to fail every time. The avatar spot in database holds url to user avatar.