You are here: i can not get addslashes/stripslashes to have the same effect on different servers « PHP Programming Language « IT news, forums, messages
i can not get addslashes/stripslashes to have the same effect on different servers

Posted by lawrence k on 01/12/07 17:29

This seems so simple, I can't believe its tripping me up. I've a
database class with a query method that looks like this:


function query($query=false) {
global $controller;
// $query = stripslashes($query);
// $query = addslashes($query);
$result = mysql_query($query);

if (!$result) {
$dbErrorMessage = mysql_error();
$controller->error("In query(), in the class Database, our last
query to the database failed. The query was '$query'. The database
server returned this message: '$dbErrorMessage' ");
}

return $result;
}


I'm working at two different companies right now, and so I'm dealing
with 2 different servers, but I've been using this same class in all my
code. One one server I have to uncomment the line with stripslashes. On
the other server I need to leave it commented. Surely there is a way to
make this code work on all servers?

 

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

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