11-19-2016, 10:25 PM
It hates me -
Parse error: syntax error, unexpected '=', expecting ')' in /home/randomserverlocation/index.php on line 49
//set check-in function
function checkIn()
{
$timein = date('H:i');
echo 'Your check-in time is '.$timein.'.';
$chkfields=array(
'user_id' = $user-data()->id, //LINE 49
'click' = $timein,
);
$db->insert('clicks', $chkfields);
}
^ This array isn't working
I have the requires at the top, init, header, and navigation with the securePage thing...so that's all there.Did I miss a ; or ' and just can't see it? My other array is working fine and displaying as it should, and looks close enough to the other one to me lol.
//generate buttons
function get_buttons()
{
$str='';
$btns=array(
1=>'Check In',
2=>'Go on Break',
3=>'Go on Lunch',
4=>'Return from Break or Lunch',
);
while(list($k,$v)=each($btns))
{
$str.=' <input class="btn btn-info" type="submit" value="'.$v.'" name="btn_'.$k.'" id="btn_'.$k.'"/>';
}
return $str;
}
^ This array works perfect.
Parse error: syntax error, unexpected '=', expecting ')' in /home/randomserverlocation/index.php on line 49
//set check-in function
function checkIn()
{
$timein = date('H:i');
echo 'Your check-in time is '.$timein.'.';
$chkfields=array(
'user_id' = $user-data()->id, //LINE 49
'click' = $timein,
);
$db->insert('clicks', $chkfields);
}
^ This array isn't working
I have the requires at the top, init, header, and navigation with the securePage thing...so that's all there.Did I miss a ; or ' and just can't see it? My other array is working fine and displaying as it should, and looks close enough to the other one to me lol.
//generate buttons
function get_buttons()
{
$str='';
$btns=array(
1=>'Check In',
2=>'Go on Break',
3=>'Go on Lunch',
4=>'Return from Break or Lunch',
);
while(list($k,$v)=each($btns))
{
$str.=' <input class="btn btn-info" type="submit" value="'.$v.'" name="btn_'.$k.'" id="btn_'.$k.'"/>';
}
return $str;
}
^ This array works perfect.