The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> error in php and mysql, Error: You have an error in your SQL syntax; check the manual that cor
jobedsno
post May 23 2014, 08:24 AM
Post #1





Group: Members
Posts: 1
Joined: 23-May 14
Member No.: 20,972



I have 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 '' at line 13 and i dont know how and where did i get that wrong

<?php

function retrieve(){
include 'connection.php';
//$result = "SELECT candidate_id, first_name,middle_name,last_name,sex FROM candidates ";

$result = "SELECT
candidates.candidate_id,
education_level,
english_level,
experience_time,
district
FROM candidates
JOIN education_quali ON candidates.candidate_id = education_quali.candidate_id
LEFT JOIN employ_history ON candidates.candidate_id = employ_history.candidate_id
WHERE candidates.candidate_id = (
SELECT candidate_id
FROM candidate_job
WHERE candidate_job.candidate_job = 'sales' ";

$query = mysqli_query($db_connection, $result)
or die("Error: ".mysqli_error($db_connection));
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jimlongo
post May 23 2014, 09:44 AM
Post #2


This is My Life
*******

Group: Members
Posts: 1,128
Joined: 24-August 06
From: t-dot
Member No.: 16



line 13 in the query is
WHERE candidate_job.candidate_job='sales'

my WAG would be that it should be candidates.candidate_jobs
since I don't see a previous mention of a table called candidate_jobs
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Kelly008
post Apr 1 2015, 05:41 AM
Post #3


Newbie
*

Group: Members
Posts: 15
Joined: 1-April 15
Member No.: 22,440



SELECT candidate_id
FROM candidate_job
WHERE candidate_job.candidate_job = 'sales' ";


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 01:02 AM