Visualizzazione dei risultati da 1 a 2 su 2

Discussione: stranezza query

  1. #1

    stranezza query

    mi spiegate il perchè se faccio questo:

    Codice PHP:
    $sql="SELECT DISTINCT Brand FROM magazine WHERE Category='$category' ORDER BY BRAND ASC";
    $QueryBrand=mysql_query($sql) or die (mysql_error()); 
    mi da 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 'SELECT DISTINCT Brand FROM magazine WHERE Category='Riscaldamento' ORDER BY BRAN' at line 1

    mentre se faccio così:
    Codice PHP:
    $QueryBrand=mysql_query("SELECT DISTINCT Brand FROM magazine WHERE Category='$category' ORDER BY BRAND ASC") or die (mysql_error()); 
    funziona tutto?

  2. #2
    ok mi scuso ma sono confuso io devo staccare ormai sono 10 ore di lavoro.

    Il problema non era quello.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.