/    Sign up×
Community /Pin to ProfileBookmark

unique job role page

Hi

Sorry to post again

I have solved all the other issues I think on my admin page but got this one that am stuck on

What should happen is a user clicks on a job and displays on a page of its own, it is getting the jobs from the database

What is happening is on the job.php page I get this error

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 ‘Designer ORDER BY id desc LIMIT 1’ at line 1

Not sure on how to fix it really, I did look round on Google etc

In the address bar it comes up with job.php?id=Web%20Designer

So I think it is sort of working

I have added a pastebin link below with the coding from the job.php page if it helps

[url]http://pastebin.com/P7KaD0pG[/url]

Thank you in advance

Ian

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 25.2013 — Find out what the actual query looks like:
[code=php]
$result = mysqli_query($con, $query) or die("Error: ".mysqli_error($con)."n$query");
[/code]

Then we can look for why it's generating a SQL syntax error.

PS: You can just post your code here within [noparse][code=php] ... [/code][/noparse] tags.
Copy linkTweet thisAlerts:
@priyankagoundNov 26.2013 — Paste the below query in your PHPMyAdmin :

SELECT id, ref, role, division, location, salary, description FROM jobs WHERE division='IT' AND id = 'Web Designer' ORDER BY id desc LIMIT 1

Remember that the number of affected rows and the length of the result set are two different things.

Generally, INSERT, UPDATE and DELETE statements affect rows, while SELECT returns a result set which may be empty if no rows were matched according to the condition.

Hope this helps.
×

Success!

Help @ianhaney spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...