search

Home  >  Q&A  >  body text

Why can't the time in the database be output in PHP? How can I output the time correctly?

11.PNG

$sql4="select denglu_time from user where user_name = '$_POST[username]' and password = '$_POST[u_password]'";
$result4 = mysql_query( $sql4);
$row1 = mysql_num_rows($result4);

echo "Time$row1[denglu_time]";

Why can’t the time in the database be output? How can I output the time correctly?

无花果树无花果树1989 days ago1484

reply all(2)I'll reply

  • angryTom

    angryTom2019-08-05 17:52:25

    You can try to store the timestamp in the database, and then convert the timestamp into time in PHP when needed

    reply
    0
  • kanglecheng

    kanglecheng2019-07-31 16:54:20

    $row1['denglu_time']
    The subscript needs to be quoted for a string. If there are no quotes, if there is a constant equal to the index value at this time, the index will be converted to a constant value

    reply
    0
  • Cancelreply