[phpOpenTracker-devel] [Bug #3578] Bug in mysql.php file - db connection reqd for prepareString
[email protected] Mon, 14 Mar 2005 13:26:27 -0900 (AKST)
| Newsgroups | gmane.comp.web.phpopentracker.devel |
|---|---|
| Message-ID | <[email protected]> |
Bug #3578, was updated on 2005-Mar-14 13:17 Here is a current snapshot of the bug. Project: phpOpenTracker Category: None Status: Open Resolution: None Bug Group: None Priority: 5 Submitted by: whit1206 Assigned to : none Summary: Bug in mysql.php file - db connection reqd for prepareString Details: The problem is that a lot of the time, phpOpenTracker is causing errors to appear in the apache error log that are the following: [Fri Feb 25 14:01:51 2005] [error] PHP Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/websites/main/html/scripts/phpOpenTracker/DB/mysql.php on line 181 This problem from what I can tell is due to mysql_real_escape_string is expecting a db connection and its somehow has lost its connection. I also noticed the prepareString function (which this is in) didn't call stripslashes before the call like it did in the DB.php file with the same function. Around this same time, we also started getting db table corruptions with mysql. It was always the phpOpenTracker db that was getting corrupt. When however, I took out the mysql_real_escape_string function and made it use mysql_escape_string, all the corruptions and error messages (above) went away. I am using phpOpenTracker ver 1.50RC2 on a redhat box with Php ver 4.3.8 and apache 1.3.9. Follow-Ups: Date: 2005-Mar-14 13:26 By: whit1206 Comment: Also, it is worth mentioning that the stripslashes should only be called if magic quotes is on (just like in DB.php). ------------------------------------------------------- For detailed info, follow this link: http://developer.berlios.de/bugs/?func=detailbug&bug_id=3578&group_id=2025