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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.