Need help in php with select or if

Discussion in 'Web Design and Development' started by pdent1, Feb 3, 2009.

  1. pdent1 macrumors newbie

    Feb 3, 2009
    Alright I have came up with :


    $result = mysql_query('SELECT banner, url FROM tb_ads ORDER BY RAND() LIMIT 1') or exit(mysql_error());
    $row = mysql_fetch_assoc($result);
    $a = $row['plan'];
    $b = $row['membersb'];

    echo '<center>';
    echo '<a href="' . $row['url'] . '"><img border="0" src="' . $row['banner'] . '" alt="Advertisement" style="position:absolute;top:620;z-index:1"></a>';
    echo '</center>';
    //$queryb = "UPDATE tb_ads SET membersb='$membersb' +1 WHERE id='$id'";
    //mysql_query($queryb) or die(mysql_error());



    The problem I am having is if plan= plan<=members then i need it to not show this banner.
    I was wonder is there a way to implement and if statement like :
    if ($a <= $v){
    go get another $result till it does not <=
    or can you put in a Where statement in the Select to like
    Where plan='plan>=membersb' never seen that but dunno if there is a way to do it that I don't know...

    I'm really lost on how I would do this.
  2. pdent1 thread starter macrumors newbie

    Feb 3, 2009
    i figured out a different way of doing this...

Share This Page