SQL Error

SQL 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 ') AND (deleted != 1) AND (enabled = 1) LIMIT 1' at line 7

Original query: SELECT count(c.cid) as count FROM content_related_content crc LEFT JOIN content c USING (cid) LEFT JOIN content_speciality cs USING(cid) WHERE (crc.r_cid = 23) AND (sid = ) AND (deleted != 1) AND (enabled = 1) LIMIT 1

Table Info
FieldTypeNullKeyDefaultExtra
cid int(11) unsigned NO      
r_cid int(11) unsigned NO      


Joined Table:
FieldTypeNullKeyDefaultExtra
cid int(11) unsigned NO PRI    auto_increment 
subject varchar(255) YES MUL     
intro text YES      
content mediumtext YES      
date_created datetime YES      
date_modified datetime YES      
enabled tinyint(1) unsigned YES    
deleted tinyint(1) unsigned YES    
ref varchar(50) YES      
sm_intro text YES      
tags varchar(250) YES      
video int(11) unsigned YES      
meta_title varchar(250) YES      
meta_description text YES      
video_embed text YES      


Request Info
VarValue
cid 23
type text
PHPSESSID d3a5359434327e911d081ea47818a625


Server Info
VarValue
HTTP_USER_AGENT CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
DOCUMENT_ROOT /home/inverness/public_html_alere/
SCRIPT_FILENAME /home/inverness/public_html_alere/article/article.php
REDIRECT_QUERY_STRING cid=23&type=text
REDIRECT_URL /articles/inverness-medical-introduces-new-techlabr-c-diff-quik-chek-completetm-23/text.htm
REQUEST_METHOD GET
QUERY_STRING cid=23&type=text
REQUEST_URI /articles/inverness-medical-introduces-new-techlabr-c-diff-quik-chek-completetm-23/text.htm
SCRIPT_NAME /article/article.php
PHP_SELF /article/article.php
REQUEST_TIME 1283502921


Session Info
VarValue