Computer Hope

Software => Computer programming => Topic started by: 12Strings on December 18, 2019, 10:07:44 PM

Title: php time and php date
Post by: 12Strings on December 18, 2019, 10:07:44 PM
I need to update a date used field (lastused) and time used field (time). how to relate with code?
Title: Re: php time and php date
Post by: Base10 on December 23, 2019, 10:34:32 AM

Hey there,

This is a pretty cool website.  Not had much time to look at the coding though, but hope this link helps,

https://www.w3schools.com/php/php_date.asp (https://www.w3schools.com/php/php_date.asp)
Title: Re: php time and php date
Post by: 12Strings on January 21, 2020, 09:29:25 PM
hi guys, thought I'd try this.  Trying to display records in database. Below is my code: Help?
-------------------------------------------------------
<!DOCTYPE html><html>
<head></HEAD><body><center>
<center>lookup Link List</center>


<?php
error_reporting(E_ALL ^ E_NOTICE);
// error_reporting(0);
<?php
include('lookupdb-connect.php');
$query = "SELECT * FROM `lookuptbl` WHERE `target` = `$target` ORDER by target Asc";
$result = $mysqli->query($query) or die($mysqli->error.__LINE__);
      while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
 {
echo '<table style="border:1px solid red;">',
 '<tr align="center" >
<td>', $row['target'], '</td>
<td>', $row['purpose'], '</td>
<td>', $row['user'], '</td>
<td>', $row['password'], '</td>
<td>', $row['email'], '</td>
<td>', $row['sec?'], '</td>
<td>', $row['secAns'], '</td>
<td>', $row['visits'], '</td>
<td>', $row['lastdate'], '</td>     
<td>', $row['lasttime'], '</td>
<td>', $row['saved?'], '</td>                             
            </tr>
             </table>';
?>
</body></html>
-----------------------------------------------
this is displayed:

lookup Link List

query($query) or die($mysqli->error.__LINE__); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo '', '
', $row['target'], ' ', $row['purpose'], ' ', $row['user'], ' ', $row['password'], ' ', $row['email'], ' ', $row['sec?'], ' ', $row['secAns'], ' ', $row['visits'], ' ', $row['lastdate'], ' ', $row['lasttime'], ' ', $row['saved?'], '
'; ?>
Title: Re: php time and php date
Post by: Base10 on February 25, 2020, 04:47:10 AM

Hey there,

Hope you got this one working.  Sorry nobody has got back to you.  If you're not still having issues with this can you close the thread please.

your code should have " " and where you have , should be a stop like . and also should have echo at the start.

so

Code: [Select]
<td>', $row['target'], '</td>
Should be

Code: [Select]
echo "<td>".$row['target']."</td>";
I'm sure by now you have had the answer, so hope all is well with you, and if you could close the thread please that would be great, thanks!