Hello,
Thanks for replying but I'm wanting to do the compare before I pull back the data. I don't want to have to itterate through all the records to search for the current date. Eventually there will be thousands of records.
I just can't figure out why something like:
WHERE PostDate = CURDATE()
or even
WHERE PostDate = '2004-08-30'
is not working.
Actually I should clarify, it does work if there is no embedded script. If after finding that all I do is post the value then it works. However if I do a:
if (!$posting) {
}else{}
it always validates to true, where $posting is my SQL Result. Here is the code I have right now, if it helps.
<?PHP
dbConnect("davidd_poetry");
$posting = mysql_query("SELECT UserID,Title,DateWritten,Poem FROM ind_poems WHERE PostDate=CURDATE()");
if (!$posting) {
echo "no match found - $ptoday";
$result = mysql_query("select UserID,Title,DateWritten,Poem from ind_poems where Posted < 1 limit 1");
if (!$result){
echo "No Matches Found";
}else{
while ($row = mysql_fetch_row($result)){
$uid = $row[0];
dbConnect("davidd_RegUsers");
$poetresult = mysql_query("select Name from RegUser where UserID = $uid limit 1");
$poet = mysql_fetch_row($poetresult);
$poem = $row[3];
$poem = str_replace ("\r\n","<br>",$poem);
$date = convertDate($row[2], "F d, Y");
echo "<Table Border=0 cellspacing=1 cellpadding=5 width=475>
<tr><td align=left><font size=4><b>$row[1]</b></font><br>
<i>$poet[0]</i><br>
$date</td></tr>
<tr><td align=center>$poem</td></tr>";
$cdate = convertDate($row[2], "Y");
echo "<tr><td align=right><a href=copyright.php><font size=-1 color=000000>© $cdate $poet[0]</font></a></td></tr>
</table>";
}
}
}else{
echo "match found - $ptoday";
while ($row = mysql_fetch_row($posting)){
$uid = $row[0];
dbConnect("davidd_RegUsers");
$poetresult = mysql_query("select Name from RegUser where UserID = $uid limit 1");
$poet = mysql_fetch_row($poetresult);
$poem = $row[3];
$poem = str_replace ("\r\n","<br>",$poem);
$date = convertDate($row[2], "F d, Y");
echo "<Table Border=0 cellspacing=1 cellpadding=5 width=475>
<tr><td align=left><font size=4><b>$row[1]</b></font><br>
<i>1. $poet[0]</i><br>
2. $date<br>
3. $row[4]</td></tr>
<tr><td align=center>4. $poem</td></tr>";
$cdate = convertDate($row[2], "Y");
echo "<tr><td align=right><a href=copyright.php><font size=-1 color=000000>© $cdate $poet[0]</font></a></td></tr>
</table>";
}
}
?>
Thanks again for any assistance. I'm just STUCK.
David Devaney, Jr.