PDA

View Full Version : Get back a value from a field ....


grog6
11-24-2002, 09:26 AM
Hi, I don't know if my title is very understandable .... sorry :hurt:

I've a problem with a new hack I'm finishing ....

So, I'd like to get back a value from a field and compare it to something

I've in my table thread a fiel called adresse_icone and I'd like to get back this value for a special thread and compare it to an other value .... hum :alien: , I don't think I'm understandble

That's what I'd like to do :


$threadadr=$DB_site->query_first("SELECT adresse_icone FROM thread WHERE threadid='$threadid'");

if (($threadadr)!=(''))
{
$img="<img src=";
$alt="alt=";
$fin=">";
}


in the global.php file to get back $img, $alt and $fin in the template forumdisplay_threadbit

If the field is empty, I don't want to do it

The query doesn't seem to be good ... Help me plizzzzzz ;)

Xenon
11-24-2002, 01:25 PM
use this instead:

$threadadr=$DB_site->query_first("SELECT adresse_icone FROM thread WHERE threadid='$threadid'");

if (trim($threadadr['adresse_icone'])!='')
{
$img="<img src=";
$alt="alt=";
$fin=">";
}