By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,824 Members | 1,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,824 IT Pros & Developers. It's quick & easy.

Please help with this bit of code

P: n/a
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($query);
$row = mysql_fetch_array($result);

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

?>

<br><br>
<img src="imagesb/<? $row['picname'];?>">
</BODY>
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I noticed that Message-ID: <T7**************@news20.bellglobal.com> from
Acorn Tutors contained the following:
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.


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/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.