|
Posted by Rik on 02/04/07 15:34
zek2005 <esapoznik@gmail.com> wrote:
> Hi !!!
Hello !!!
> 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
> $mensaje = str_replace('\"',""",$mensaje);
This will result in a parse error, preventing the script from ever
executing (which you would know if you had display_errors on, which is
very handy in development).
Change the line to the following and you'll get the expected behaviour:
$mensaje = str_replace('\"','"',$mensaje);
--
Rik Wasmus*
Navigation:
[Reply to this message]
|