Please help with this bit of code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Acorn Tutors

    Please help with this bit of code

    What Im trying to do is select a single entry from a table called HEADPIC
    where the current date and time are after a datetime value
    in a field called POSTED and before a datetime value in a field called
    APOSTED. Then I want to take the matching text (which is the name of a
    picture)
    in the PICNAME field and put it in a link so that, depending on the date, a
    different picture will show up (for holidays and such). I have two ways that
    I have tried to do this, neither of them works. Can anyone help me with the
    coding?

    Help MUCH appreciated,
    Doug


    <BODY>
    <?
    $query = "SELECT * from headpic WHERE posted >= NOW() AND aposted < NOW()";
    $result = mysql_query($qu ery);
    $row = mysql_fetch_arr ay($result);

    print("<img src=\"imagesb/{$row['picname']}\">");

    ?>

    <br><br>
    <img src="imagesb/<? $row['picname'];?>">
    </BODY>


  • Geoff Berrow

    #2
    Re: Please help with this bit of code

    I noticed that Message-ID: <T77pb.21$VM.50 28@news20.bellg lobal.com> from
    Acorn Tutors contained the following:
    [color=blue]
    >where the current date and time are after a datetime value
    >in a field called POSTED and before a datetime value in a field called
    >APOSTED.[/color]

    Are you living in some strange space time continuum where now actually
    doesn't mean now?
    http://www.webdevelopersnotes.com/tutorials/sql/25.php3 may help.
    --
    Geoff Berrow
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    Working...