PHP + mySQL - Variables being returned are incorrect?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

crEA-tEch

Thread Starter
Joined
Jul 2, 2003
Messages
80
Hi all!

I've been trying to get my head around this for hours, but I'm utterly confused.

I'm trying to query from a database by date.

In a nutshell, I want to retrieve information from a 'courses' table, that is OLDER than today, but between 2 dates... please see the attached image (the query is echo'd here so you can see it).

Problem is, as you can see by the image - it just displays all the information in the table - as far as I can see. It doesnt seem to take into consideration my query by the dates I supplied.

Here is my code:

PHP:
$queryx = "SELECT * FROM courses WHERE date > '$day' AND date >= '$fromm' AND date <= '$too'";
echo $queryx;
///$queryx  = "SELECT * FROM courses WHERE date > current_date ORDER BY fromm ";
$resultx = mysql_query($queryx);

while($rowx = mysql_fetch_array($resultx, MYSQL_ASSOC))
{ 



?>              
            <table border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td width="127"  bgcolor="#FFFFFF"><span class="style9"><? echo ($rowx['date']);  ?></span></td>
                <td width="132"  bgcolor="#FFFFFF"><span class="style9"><? echo ($rowx['title']);  ?></span></td>
              </tr>
              <tr>
         <td colspan="2" bgcolor="#FFFFFF"><span class="style7"><? echo ($rowx['description']);  ?></span></td>
              </tr> 
            </table>       



            <? } ?>

I'd appreciate any help whatsoever. I'm pulling my hair out!

Thanks guys,

Nick
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top