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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.