Jump to content

echo date field from MySQL table


f.ismayil

Recommended Posts

Here is one part of php code. Here I try to show in last 1 month which dates exactly user made orders. When I run the SQL code in command prompt it works. I think problem is in while loop.

 

Thanks beforhand for contribution.

 

 

$query = "SELECT Date FROM orders WHERE User='$username' and DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= Date;";

$result = mysql_query($query,$link_id) or die (mysql_error());

 

echo "<table border='1'>

        <tr>

          <td> Last 1 month's orders:</td>

        </tr>";

   

      while($order_date = mysql_fetch_row($result)) {

        echo "<tr>";

          echo "<td>" . $order_date[0] . "</td>";

        echo "</tr>";

      }

     

      echo "</table>

Link to comment
https://forums.phpfreaks.com/topic/234324-echo-date-field-from-mysql-table/
Share on other sites

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.