Jump to content

Invalid function syntax


wepnop

Recommended Posts

( ! ) Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\lib\bd.php on line 15
Call Stack
#	Time	Memory	Function	Location
1	0.0017	375096	{main}( )	..\wep.php:0
2	0.0031	380792	include( 'C:\wamp\www\lib\lib_vago.php' )	..\wep.php:8

 

¿anybody? maybe the problem is that function arguments cant have a function call as default value...

Default values for function parameters cannot be function calls.

 

If you need them to be dynamic, do something like:

 

function conectar_bd($nombre_bd = NULL, $host = NULL, $usuario = NULL) {
    if ($nombre_bd === NULL) {
        $nombre_db = $reg->getConf("Nombre bd");
    }
   // Repeat for other parameters
}

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.