You are here: Problem inserting a function - Easy question « PHP Programming Language « IT news, forums, messages
Problem inserting a function - Easy question

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация