www.webdeveloper.com
Results 1 to 3 of 3

Thread: unique job role page

  1. #1
    Join Date
    Apr 2012
    Posts
    39

    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

    http://pastebin.com/P7KaD0pG

    Thank you in advance

    Ian

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,239
    Find out what the actual query looks like:
    PHP Code:
    $result mysqli_query($con$query) or die("Error: ".mysqli_error($con)."\n$query"); 
    Then we can look for why it's generating a SQL syntax error.

    PS: You can just post your code here within [php] ... [/php] tags.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Sep 2013
    Posts
    221
    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.
    strad solutionswww.stradsolutions.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles