Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Is anything actually wrong with this?!?!?!?
Old 08-24-2007, 06:36 AM Is anything actually wrong with this?!?!?!?
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Code:
$sql=mysql_query("SELECT * FROM photos WHERE default='0'");
I keep getting a MySQL error!!! I dont know why, because in my table 'photos', I have a field called 'default', and each row for it has a value of either 0 or 1.
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 08-24-2007, 07:50 AM Re: Is anything actually wrong with this?!?!?!?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
"default" is a reserved word (see http://dev.mysql.com/doc/refman/5.1/...ved-words.html )

When posting error messages, you really ought to include the message itself.

Try this instead:

Code:
$sql=mysql_query("SELECT * FROM `photos` WHERE `default`=0");
or, if you have the default field as char instead of tinyint, then
Code:
$sql=mysql_query("SELECT * FROM `photos` WHERE `default`='0'");
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 08-24-2007, 08:06 AM Re: Is anything actually wrong with this?!?!?!?
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
ahhh thanks!
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 08-25-2007, 08:39 AM Re: Is anything actually wrong with this?!?!?!?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Always the simple thing
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to Is anything actually wrong with this?!?!?!?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13111 seconds with 12 queries