php - SQL Syntax error in where clause -
i've been searching around , couldn't find problem mine. i'm getting syntax error, no matter how @ it, there doesn't seem wrong it.
it goes this:
<?php if(!empty($_post['proj_id'])||!empty($_post['task_uid'])) die("invalid proj_id or task_uid."); $query = " select pm.id, pm.proj_id, pm.task_uid, pp.pipeline_name, pm.proj_pipeline_order, pcrs.gestor_projeto, pcrs.prioridade, pcrs.tecnologia, pcrs.resp_programa projetos_main pm inner join projetos_pipeline pp on pm.task_uid = pp.task_uid right join pcrs on pp.pcr = pcrs.num_doc pm.proj_id = ".$_get['proj_id']." , pm.task_uid = ".$_get['task_uid']." "; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); $pipeline = $row ['pipeline_name']; $ordem = $row ['proj_pipeline_order']; $gestor = $row ['gestor_projetos']; $tecnologia = $row ['tecnologia']; $gestorportfolio = $row['resp_programa']; ?>
is clause wrong? dots shorten select. message
"you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'and pm.task_uid =' @ line 20"
it may issue quotes, try this
select pm.id, pm.proj_id, pm.task_uid, . . . pcrs.resp_programa projetos_main pm inner join projetos_pipeline pp on pm.task_uid = pp.task_uid right join pcrs on pp.pcr = pcrs.num_doc pm.proj_id = '".$_post['proj_id']."' , pm.task_uid = '".$_post['task_uid']."'
also confirm existence of $_get['task_uid' , $_get['proj_uid']
Comments
Post a Comment