Questo è il codice
Codice PHP:
<?php
$tag_ = $_GET['tag'];
$tag= addslashes($tag_);
$tag= htmlspecialchars($tag);
$onlycon = str_replace("_", " ", "$tag");
$query = mysql_query("SELECT * FROM prodotti_ba WHERE nome LIKE '%".$onlycon."%' OR descrizione LIKE '%".$onlycon."%' ORDER BY RAND() LIMIT 0,4");
while($result = mysql_fetch_array($query)) {
?>
<div style="width:300px; float:left; height:150px; background-color:#FFFFFF;">
<div style="float:left; width:100px;">[url="<?php echo $result['COL 6']; ?>"][img]<?php echo $result['COL 9']; ?>[/img][/url]</div>
<div style="float:left; width:195px; margin-top:15px; margin-left:4px;"> <p id="url-banner">[url="<?php echo $result['COL 6']; ?>"]<?php echo $result['COL 1']; ?>[/url]</p></div>
</div>
<?php
}
?>
Se tolgo il WHERE il tutto funziona è mi stampa i prodotti in modo random