|
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]
|