Jump to content

I cannot see the error, simple fix!


Lamez

Recommended Posts

Hey guys, for whatever reason I am getting this syntax error:

 

Parse error: syntax error, unexpected '(', expecting ')' in C:\wamp\www\core\functions.php on line 229

 

here is line 229:

 

<?php
function addError($error, $ip = getIp(), $date = currentDate(), $time = currentTime()){
?>

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/198772-i-cannot-see-the-error-simple-fix/
Share on other sites

okay I did something like this in my function definition. Would this be considered "proper"

 

<?php
function addErrorLog($error, $ip = NULL, $date = NULL, $time = NULL){
if($ip == NULL)
	$ip = getIp();
if($date == NULL)
	$date = currentDate();
if($time == NULL)
	$time == currentTime();
mysql_query("INSERT INTO ".TBL_ERROR_LOG." (ip_address, time, date, error) VALUES ('$ip', '$time', '$date', '$error')");
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.