Non so se in questi giorni mi sono drogato di brutto, ma non capisco perchè
1)funziona
2)non funzionaCodice PHP:$result = mysql_query("SELECT * FROM eventi WHERE `$attr` = 1");
while($arr = mysql_fetch_array($result) ){ echo $arr[0]; }
3)non funzionaCodice PHP:$result = mysql_query("SELECT * FROM eventi WHERE $attr = 1");
while($arr = mysql_fetch_array($result) ){ echo $arr[0]; }
4)non funzionaCodice PHP:$result = mysql_query("SELECT * FROM eventi WHERE \"$attr\" = 1");
while($arr = mysql_fetch_array($result) ){ echo $arr[0]; }
Codice PHP:$result = mysql_query("SELECT * FROM eventi WHERE ".$attr." = 1");
while($arr = mysql_fetch_array($result) ){ echo $arr[0]; }
![]()

Rispondi quotando

