Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2013
    Thanked 0 Times in 0 Posts

    SQL Fetch not showing results.


    I'm fairly new to PHP coding, and also all other forms of coding too...

    I run a website that someone else does the "big boy jobs" on, while I have to somehow figure out the little ones.

    I am trying to fetch new results from the SQL.

    This one worked in the old version- $q_videos = "SELECT * FROM `videos`,`users` WHERE (`videos`.uid = `users`.uid AND `catagory` LIKE '$cat')" or die( "Unable to select database");

    But I am trying to add an "active = 1" as we have active, and inactive videos now.

    The active part is kept in the Videos section in the SQL also, so I assumed this would work;
    $q_videos = "SELECT * FROM `videos`,`users` WHERE (`videos`.uid = `users`.uid AND `catagory` LIKE '$cat' AND `active` = '1')" or die( "Unable to select database");

    I probably did something so tiny wrong, but I'm a newb who needs sympathy.

    Any help would be super lovely!

  2. #2
    Senior Coder
    Join Date
    Dec 2005
    Thanked 79 Times in 79 Posts
    I suppose

    `active` = 1
    instead of
    `active` = '1'

    might help

    If there are such data (Type int, value 1) in 'active' column of table 'videos'

    Otherviuse you simply don't have '1' data in 'active' column of Type varchar or similar
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  3. #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    You also don't say what error you get, if any.

    And did you try the query from a query tool, *NOT* from your own PHP code?
    Be yourself. No one else is as qualified.


Posting Permissions

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