1
$query = mysql_query("SELECT * 
                      FROM lista_utenti, tbl_users, prodotti 
                      WHERE lista_utenti.userID= tbl_users.userID 
                        AND prodotti.id_prod= lista_utenti.id_prod 
                        AND tbl_users.codice= '$codice' 
                        AND lista_utenti.stato='0'"); 
while ($row = mysql_fetch_array($query)) {
    $data=$row['data'];
    echo '<tr class="clickable warning dropdown-deliverable" >';
    echo "<td >".$row['data']."</td>"; //this show yyyy-mm-dd hh-mm-ss
}
echo '<td>
         <form action="approva.php" method="get">
         <input type="hidden" name="data1" value='.$data.' /> 
         <input type="text" name="data1" value='.$data.' /> //this show ONLY yyyy-mm-dd 
         <button class="btn btn-warning" type="submit" name="btn-approva" id="btn-approva"> Approva </button>
         </form>
      </td>';
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • change input type from text to datetime – clearshot66 Apr 12 '17 at 19:33
  • 1
    @clearshot66 Why would text not show the whole thing? – Barmar Apr 12 '17 at 19:35
  • @Barmar it should if done correctly but easiest for him to have it the way he wants would be to put datetime as type – clearshot66 Apr 12 '17 at 19:36
  • `type=datetime` isn't supported by most browsers. – Barmar Apr 12 '17 at 19:38
  • most is incorrect. HTML 5 browsers support it. – clearshot66 Apr 12 '17 at 19:39
  • Every time you use [the `mysql_`](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php) database extension in new code **[this happens](https://media.giphy.com/media/kg9t6wEQKV7u8/giphy.gif)** it is deprecated and has been for years and is gone for ever in PHP7. If you are just learning PHP, spend your energies learning the `PDO` or `mysqli` database extensions and prepared statements. [Start here](http://php.net/manual/en/book.pdo.php) – RiggsFolly Apr 12 '17 at 19:39
  • What is the DataType of the `data` column? I am guessing its not DATETIME! – RiggsFolly Apr 12 '17 at 19:41
  • It's because you're not containing the value. Use "" around the `'. $data.'` so it becomes `"'.$data.'"` – junkfoodjunkie Apr 12 '17 at 19:58
  • junkfoodjunkie it works! Thank you so much! Thanks also to all of you to answer me – AlexLoManto Apr 12 '17 at 21:05

0 Answers0