The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need a point in the right direction
#10
It's ugly, but it's working haha

//set check-in function
function checkIn()
{
$timein = date('H:i');
echo 'Your check-in time is '.$timein.'.';
$chkfields=array(
'id' => $logged_in->id,
// 'username' => $logged_in->username, <-- Can't get this working for some reason though
'timein' => $timein,
);

$db = DB::getInstance();
$db->insert('clicks', $chkfields);
}

root@training [/home/randomserverpathhere/]# mysql somedbhere -e 'select * from clicks;'
+----+----------+--------+
| id | username | timein |
+----+----------+--------+
| 4 | | 21:35 |
+----+----------+--------+
root@training [/home/somepathhere]# mysql somedbhere -e 'describe clicks;;'
+----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| username | varchar(255) | NO | | NULL | |
| timein | varchar(255) | NO | | NULL | |
+----------+--------------+------+-----+---------+----------------+

Unfortunately I can't figure out the datetime/timestamp issue between PHP and the DB just yet...but I have made real progress now lol. Just had to dig around the user class docs a bit and watch the db class videos to understand why it wasn't working.
  Reply


Messages In This Thread
Need a point in the right direction - by sandrews - 11-18-2016, 06:02 PM
Need a point in the right direction - by dan - 11-18-2016, 06:33 PM
Need a point in the right direction - by sandrews - 11-18-2016, 06:44 PM
Need a point in the right direction - by dan - 11-18-2016, 06:47 PM
Need a point in the right direction - by sandrews - 11-19-2016, 04:04 AM
Need a point in the right direction - by Brandin - 11-19-2016, 02:19 PM
Need a point in the right direction - by dan - 11-19-2016, 05:14 PM
Need a point in the right direction - by sandrews - 11-19-2016, 10:25 PM
Need a point in the right direction - by sandrews - 11-20-2016, 12:23 AM
Need a point in the right direction - by sandrews - 11-20-2016, 02:40 AM
Need a point in the right direction - by mudmin - 11-20-2016, 05:57 PM
Need a point in the right direction - by mudmin - 11-20-2016, 06:04 PM
Need a point in the right direction - by sandrews - 11-21-2016, 05:39 PM
Need a point in the right direction - by mudmin - 11-21-2016, 07:42 PM
Need a point in the right direction - by sandrews - 11-22-2016, 12:58 AM
Need a point in the right direction - by mudmin - 11-22-2016, 01:00 AM
Need a point in the right direction - by sandrews - 11-22-2016, 03:43 AM
Need a point in the right direction - by mudmin - 11-22-2016, 07:42 AM
Need a point in the right direction - by sandrews - 11-23-2016, 06:47 PM
Need a point in the right direction - by sandrews - 11-24-2016, 12:43 AM
Need a point in the right direction - by mudmin - 11-24-2016, 03:55 PM
Need a point in the right direction - by sandrews - 11-24-2016, 04:10 PM
Need a point in the right direction - by mudmin - 11-24-2016, 04:19 PM
Need a point in the right direction - by sandrews - 11-24-2016, 09:41 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)