SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    calling from url

    Hi guys

    Im trying to list all jobs in the database via category that has been passed in the url

    sector.php?category=Construction

    PHP Code:
    $category $_GET["category"];

    $sql = ("select * from   jobs where category = $category"); 
    can anyone see my error?

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put the variable between single quotes:
    PHP Code:
    $query = ("select * from jobs where category = '$category'"); 
    FOR SALE: 1 set of morals, never used, will sell cheap


Bookmarks

Posting Permissions

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