Jump to content

$date123 will echo the date but wont work when searching in db ?


runnerjp

Recommended Posts

the code below does not echo yes. If i add the date manually () if echos yes...  $date123 also echos out the date!

 

where am i going wrong?

 

             <?php 

                                 

                                                 $getthreads = 
                                "Select * from daddiary  ORDER BY DATE (STR_TO_DATE( `date`, '%d/%m/%Y ' )) ASC"; 

                            $getthreads2=mysql_query($getthreads) or die("Could not get threads"); 

                            while ($getthreads3=mysql_fetch_array($getthreads2)) 
                                { 
                      
                                ?><tr <? if ( $getthreads3['date'] == date("d/m/Y") ) { echo 'bgcolor="#CAD9D9"'; }?> > 
<td width="10%" height="39" align="center" valign="middle"><?php 
                            echo $getthreads3['date'];?> 

                                </td>  
<td width="15%" align="center" valign="middle"> <?php echo $getthreads3['am']; 
$date123=$getthreads3['date'];

                                 $getdate= "Select * from dadreps where date = $date123"; 

                            $getdate2=mysql_query($getdate) or die("Could not get threads"); 

                            while ($getdate3=mysql_fetch_array($getdate2)) 
                                { 

 

Also when it does work it echos yes the amount of times that there are rows with same date. How could i echo yes no matter how many rows it shows?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.