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