|
Posted by Rik on 01/12/07 17:36
lawrence k wrote:
> 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?
Hard to say without knowing how the query actually get's build.
Are you sure it's not a byproduct of those pesky magic_quotes?
--
Rik Wasmus
Navigation:
[Reply to this message]
|