Simple SQL not working!

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

SiKing

Registered MemberEstablished Member
Impact
6
Am I getting stupid in my young age or is my host just [insert rude word here]?

I've had many problems with my host so far and this is the second (simple) MySQL problem I've had today.

PHP:
$query = mysql_query( "SELECT * FROM certificates WHERE unique='1' ORDER BY title ASC" ) or die("SELECT Error: " .mysql_error());

Returns:

SELECT Error: 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 'unique='1' ORDER BY title ASC' at line 1

Hopefully I'm just stupid. Thanks.


Furthermore: when I changed 'unique' to 'category', it worked fine. These two fields are identical in the database (including properties) so the only way it could be wrong is if 'unique' is not spelt the same way it is in the database and i've checked it billions of times.
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
"unique" is a mysql keyword.

Try changing the field name to is_unique or similar.
 
1
Close
Muchas gracias amigo. Rep added!
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back