Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript A Tiny bit of MySQL Help.

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #28719
    Waffle
    Member
    $sql = "SELECT * FROM `jobs` WHERE `sector` = '" . $sector . "' AND `title` LIKE '%" . $title . "%'";

    Just a quick question, How do I extend this? … Add more options.. coz ive tried loads of things but I cant make it work. Can you help me extend it.. I want to have

    – Sectors
    – Title
    – Location

    #74152
    bi5on
    Participant

    $sql = "SELECT * FROM `jobs`
    WHERE `sector` = '" . $sector . "'
    AND `title` LIKE '%" . $title . "%'
    AND `Sectors` LIKE '%" . $sectors. "%'
    AND `Location` LIKE '%" . $location. "%'";

    you might want to check the case of your `fields` and of your variables $Location $location etc.

    #74151
    Waffle
    Member

    This code has made an error on a line lower down.

    $count = mysql_num_rows ( $query ) ;
    #79769
    bi5on
    Participant

    Can you share your code including my query above.

    #73054
    TT_Mark
    Member

    I recommend not selecting ‘*’ either as it is bad practice. Select the columns you need by name

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.