Jump to content

Has to work, but doesnt..


jonoc33

Recommended Posts

<?php
$req_user_info = $database->getUserInfo($req_user);
$authorsname = $req_user_info['username'];

$results = mysql_query("SELECT picture FROM ".TBL_USERS." WHERE username='{".$authorsname."}'");
while($values = mysql_fetch_array($results)){
if(!$values['picture'] == 0){
echo "<center><img src='$values[picture]' /></center>";

}
else{
echo "<center>No Profile Picture</center>";
}

}
?>

What is wrong with this code? It is meant to display an image through a link from a record in a database, but doesnt.

Mysql_error doesn't show anything wrong.

Link to comment
https://forums.phpfreaks.com/topic/84719-has-to-work-but-doesnt/
Share on other sites

@jonoc33 are you getting a blank page when you run the above code? If you do see if you can enable a setting called display_errors within the php.ini (if accessable to you) or within a .htaccess file like so:

php_value display_errors On
php_value error_reporting E_ALL

 

Make sure you place the .htaccess file within your sites root folder (where you upload your sites files to), also you don't provide a filename for the .htaccess file. The file you create is just called .htaccess

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.