|
Posted by zek2005 on 02/04/07 15:22
Hi !!!
I have the following php code
<?php
$db = mysql_connect("1", user, password)
or die ("can´t connect");
mysql_select_db(efemerides,$db);
mysql_close();
?>
I receive the error "can´t connect". Right beacuse "1" is not my
server.
Then I insert a function in the code and I do not receive the "can´t
connect" error. It seems that when I insert the function in the PHP
doesn´t work as it should
<?php
$db = mysql_connect("1", user, password)
or die ("no se ha podido conectar");
mysql_select_db(efemerides,$db);
function quitar($mensaje)
{
$mensaje = str_replace("<","<",$mensaje);
$mensaje = str_replace(">",">",$mensaje);
$mensaje = str_replace("\'","'",$mensaje);
$mensaje = str_replace('\"',""",$mensaje);
$mensaje = str_replace("\\\\","\",$mensaje);
return $mensaje;
}
mysql_close();
?>
Any suggestion?
Regards!
Ezequiel
Navigation:
[Reply to this message]
|