- Home
- Categorie
- Coding e Sistemistica
- Coding
- You have an error in your SQL syntax;
- 
							
							
							
							
							
You have an error in your SQL syntax;salve sto implementando una galleria immagini utilizzando php e pirobox (simile a lightbox).. 
 La pagina gallery mi restituisce questo errore:
 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=10' at line 1L'interrogazione al db è giusta poichè restituisce 10 che è l'id categoria che ho richiesto.. la sintassi php in questione è: <?php $dbLink = mysql_connect('', '', ''); mysql_select_db("", $dbLink); if (!$dbLink) { die('Could not connect: ' . mysql_error()); } $q = "SELECT id_categoria, titolo, descrizione FROM categorie"; $result = mysql_query($q, $dbLink) or die(mysql_error()); $categoryRows = array(); while ($row = mysql_fetch_array($result)) $categoryRows [] = $row; $str = ""; foreach($categoryRows as $categoryRow){ $str .= "<div>"; $q .= "WHERE categorie_id=" .$categoryRow['id_categoria']; echo $q; $result = mysql_query($q, $dbLink) or die(mysql_error()) ; $imageRows = array(); while ($row = mysql_fetch_array($result)) $imageRows [] = $row; $imageCount = count($imageRows); if($imageCount < 1) continue; $str .= "<a href='foto/" .$imageRows[0]['foto'] ."' class='pirobox_gall'><strong>"; $str .= "categoria: " .$categoryRow['id_categoria'] ."</strong>"; if($imageCount == 1) continue; for($i = 1; $i < $imageCount; $i++){ $str .= "<a href='foto/" .$imageRows*['foto']; $str .= "' class='pirobox_gall' title='' alt=''></a>"; } $str .= "</div>"; } echo $str; ?> ```avete qualche idea? grazie in anticipo..
 
- 
							
							
							
							
							
 Ma sei pazzo a postare i dati di accesso al db??? Ma sei pazzo a postare i dati di accesso al db???
 Edita subito!!! 
 
- 
							
							
							
							
							
 Mii nn ci avevo fatto caso Mii nn ci avevo fatto caso   
 
- 
							
							
							
							
							
che scemo, mi dite come fare per editare il messaggio? 
 
- 
							
							
							
							
							
Tasto 'Edit'. 
 
- 
							
							
							
							
							
purtroppo dopo 60 minuti nn è possibile  
 
- 
							
							
							
							
							
Contatta subito un moderatore.