Tema: que´hay mal
Ver Mensaje Individual
  #14 (permalink)  
Antiguo 25/03/2007, 10:54
okram
Invitado
 
Mensajes: n/a
Puntos:
Re: que´hay mal

Aja, asi esta mejor...

No puedes usar esa comparacion
Código PHP:
if (trim($row['check1'])=='Football Camp')) { 
puesto que estarias poniendo algo como:
Código PHP:
if (trim('Football Camp; Golf Camp; Grocery Store')=='Football Camp') { 
y pues eso siempre te va a devolver falso, o no?

Para eso tienes en PHP la función ereg() y eregi():

Código PHP:
<? 
global $cat_fields$table_ads
$sql_query="select * from $table_ads where idnum=$id";
$sql_res=mysql_query("$sql_query");
$row mysql_fetch_array ($sql_res);
 
//echo $row."MIRE QUI".$row['check1']."<br>";
echo "Imagen Aqui:";
if (
eregi('Bike Paths',$row['check1']) {
echo 
"<img src='images/si.gif' alt='Bike Paths' width='11' height='11'>";
} else {
echo 
"<img src='images/no.gif' alt='No' width='8' height='8'>";

echo 
"<br> <p></p>";
echo 
"Football Camp:";
if (
eregi('Football Camp',$row['check1'])) {
echo 
"<img src='images/si.gif' alt='Football Camp' width='11' height='11'>";
} else {
echo 
"<img src='images/no.gif' alt='No' width='8' height='8'>";
} echo 
"<br> <p></p>";
?>
Un saludo,

Última edición por okram; 25/03/2007 a las 16:12 Razón: Corrección en el código