MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old May 6th, 2008, 11:54 PM
geekjob geekjob is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 113 geekjob User rank is Lance Corporal (50 - 100 Reputation Level)geekjob User rank is Lance Corporal (50 - 100 Reputation Level)geekjob User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Days 10 h 38 m 38 sec
Reputation Power: 2
Query giving error

PHP Code:
 SELECT IF( c.user_id !=72c.user_idowner_idc.content_idc.vprivatec.transfer_idc.category_idc.system_file_name AS filenamec.content_namec.statusc.sharablect.category_namect.private, (


SELECT sr.slam_room_id
FROM slam_round_users sru
slam_rounds sr
WHERE sr
.round_status !=3
AND sr.slam_round_id sru.slam_round_id
AND user_content_id c.content_id
LIMIT 1 
) AS enter_slam, (

SELECT stage_name
FROM users
WHERE user_id 
uploader_id
) AS uploader_stage_nameuploader_id, (

SELECT count( * ) 
FROM user_grabs AS ug
WHERE ug
.user_id 
AND 
ug.content_id c.content_id
) AS grab_status
FROM user_content c
category ct
WHERE ct
.category_id c.category_id
AND (
(
transfer_status =0
AND c.user_id =72
)
OR 
content_id
IN 
(    

SELECT DISTINCT content_id
FROM video_transfer_history
WHERE user_id 
=72
AND profile_view =1
AND bam_delete =0
)
)
AND 
c.status =1
AND vprivate =0
AND private =0
ORDER BY date_uploaded DESC 
LIMIT 0 
10 


The query producing error like "#1064 - 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 'AND ug.content_id = c.content_id
) AS grab_status
FROM user_content c, categor' at line 20 ".

i am not sure what is wrong.

Reply With Quote
  #2  
Old May 7th, 2008, 02:08 AM
cafelatte cafelatte is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 26 cafelatte User rank is Private First Class (20 - 50 Reputation Level)cafelatte User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 58 m 31 sec
Reputation Power: 0
The error nearly always occurs just before the text highlighted in the error message. Go back and look at your query. I think it will be quite obvious!!!
Comments on this post
geekjob disagrees: unsatisfied with the answer
pabloj agrees: That's where the error is

Reply With Quote
  #3  
Old May 7th, 2008, 05:12 AM
Andreas19 Andreas19 is online now
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 48 Andreas19 User rank is Private First Class (20 - 50 Reputation Level)Andreas19 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 Days 6 h 47 m 53 sec
Reputation Power: 2
Code:
SELECT count( * ) 
FROM user_grabs AS ug
WHERE ug.user_id = Hello?
AND ug.content_id = c.content_id

Reply With Quote
  #4  
Old May 7th, 2008, 05:41 AM
SimonJM SimonJM is online now
Contributing User
Dev Shed Novice (500 - 999 posts) Click here for more information
 
Join Date: Mar 2006
Posts: 609 SimonJM User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonJM User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonJM User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonJM User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonJM User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonJM User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonJM User rank is First Lieutenant (10000 - 20000 Reputation Level)SimonJM User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 8 m 27 sec
Reputation Power: 194
It's easier to spot things like that if you haven't just spent the last 30 minutes (or more) pulling your hair out!
__________________
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer" - Bruce Graham

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsDatabasesMySQL Help > Query giving error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway