Results 1 to 3 of 3

Thread: Help!!

  1. #1
    Join Date
    Feb 2004
    Posts
    455

    Default Help!!

    Hello,

    I would like to do something like:

    $sql = "SELECT _picture1 FROM phpbazar_ads WHERE publicview=1 ORDER BY RAND() limit 1";
    $result = mysql_query($sql);
    Some time the field "_picture1" is empty how could I select only the the rows where that field is not empty?

    Thanks

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Try this
    Code:
    SELECT _picture1 FROM phpbazar_ads WHERE publicview=1 AND _picture1 <> '' ORDER BY RAND() limit 1

  3. #3
    Join Date
    Feb 2004
    Posts
    455

    Default

    Thank you
    Last edited by aladdin1; 05-26-2006 at 11:10 AM.

Posting Permissions

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