News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

updated to 2.02 and getting this error...

Started by DarkAngel612, March 22, 2012, 04:02:46 AM

Previous topic - Next topic

DarkAngel612

PHP Warning:  mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/xxxx/public_html/xxxxx/Sources/Subs-Db-mysql.php on line 132

I found the other threads from last year but was wondering if there is something new to do or an idea what is happening?

I am also showing this error to be in effect since [09-Mar-2012 08:32:09]

The above message appears over and over with [21-Mar-2012 22:40:11] appearing to be the last entry---have disabled the sites error log to see if a new one generates again with this error and as for admin/error log the only entries are for an undefined error:

http://thefantasiesattic.net/attic/index.php?board=350.0;nowap

8: Undefined index: costa_topico_normal
File: Themes/chemical/MessageIndex.template.php
Line: 237

8: Undefined index: costa_topico_fixo
File: Themes/chemical/MessageIndex.template.php
Line: 226

which the other forums (1 test 1 live) that have this theme do not have this error or the other one, just our main forum.

Apache version      2.2.17
PHP version     5.2.17
MySQL version     5.0.95-community
Architecture     x86_64
Operating system     linux
Perl version     5.8.8
Kernel version     2.6.18-028stab089.1


SMF 2.02

Mods:

Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Kermit

Those undefined index errors have something to do with one of your installed modifications,to be more specific

http://custom.simplemachines.org/mods/index.php?action=parse;mod=3300;attach=195226;smf_version=2.0.2

you can check the coding,apparently the mod was not completely uninstalled,so you can remove the rest code manually

and regarding the first error,i don't know how to fix it
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

DarkAngel612

Quote from: Kermit on March 22, 2012, 04:50:59 AM
Those undefined index errors have something to do with one of your installed modifications,to be more specific

http://custom.simplemachines.org/mods/index.php?action=parse;mod=3300;attach=195226;smf_version=2.0.2

you can check the coding,apparently the mod was not completely uninstalled,so you can remove the rest code manually

and regarding the first error,i don't know how to fix it

I am so sorry I should have been more specific...that 2nd error is not from a mod, it is from something that is not set in the language file for the Chemical theme.

But thanks anyway I will need to contact the creator -- runic -- for an answer


however, I am going to check the coding too even though I do not have that particular mod installed.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Kermit

Nope,those strings have nothing to do with a theme,they belong to that mod which i have linked,just you need to check the codes manually
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

DarkAngel612

Quote from: Kermit on March 22, 2012, 07:22:11 AM
Nope,those strings have nothing to do with a theme,they belong to that mod which i have linked,just you need to check the codes manually

ok will do even if it never has been installed...lol
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

DarkAngel612

Weird cause the sticky topics are in adifferent color than the regular ones---I have never used that mod so did not know it existed...lol

I went into the theme and changed its message file then went into default language file and added the info there and it would seem the error has gone away.

Thanks


but the one:

[22-Mar-2012 07:56:48] PHP Warning:  mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/tttttttt/public_html/ttttt/Sources/Subs-Db-mysql.php on line 132

still fills up the error log
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Shambles

No so sure it's a wise idea to completely change the topic title when part of your issue has been solved; makes it tough to keep track of things  ::)

DarkAngel612

Quote from: Shambles on March 22, 2012, 05:10:01 PM
No so sure it's a wise idea to completely change the topic title when part of your issue has been solved; makes it tough to keep track of things  ::)

sorry but figured it might get more help drawn in here will put it back
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal


DarkAngel612

How weird is it????

I did the edits for the theme problem, waited to see if error would return---deleted the error log off server---

no error log that error that overpopulated the log is now gone...no error log, no error, happy forum

Not sure how/why that theme error would make the other error but it sure seems to be the case.

I had read that one before making my own thread and it made absolutely no sense to me at the time--headache with weather lately---raining for 3 or 4 days and my head no like...lol

Thanks for help...I am sure to come back with something else.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

kat

You'll be most welcome! :)

Glad you're sorted.

DarkAngel612

Well folks that primary error filling up the logs is back. Seems it came back around the 23rd of this month and like the other time seems it is along with either undefined text or other errors like these:

[23-Mar-2012 18:01:04] PHP Notice:  Undefined index:  server in /home/tttt/public_html/ttt/Sources/Subs-Post.php on line 622
[23-Mar-2012 18:01:04] PHP Notice:  Undefined index:  utf8 in /home/ttt/public_html/tttt/Sources/Subs-Post.php on line 1257
[23-Mar-2012 18:01:04] PHP Notice:  Undefined index:  utf8 in /home/tttt/public_html/tttt/Sources/Subs-Post.php on line 1259
[23-Mar-2012 18:01:04] PHP Notice:  Undefined index:  server in /home/tttt/public_html/tttt/Sources/Subs-Post.php on line 1279

[23-Mar-2012 18:01:04] PHP Warning:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: invalid UTF-8 string at offset 8 in /home/xxxx/public_html/xxx/Sources/Subs-Post.php on line 1279

[24-Mar-2012 18:47:48] PHP Warning:  mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/xxxx/public_html/xxxx/Sources/Subs-Db-mysql.php on line 132




There was also an undefined $txt and language error for the subs-post.php file where I just to test...replaced the $txt with $text and thus far the error seems to be gone again....but who knows for how long.

Therefore I have removed the solved part of this thread....and it seems geared to being on  a shared server but i am on a VPS for our sites and only one forum gets this pile of errors:

PHP Warning:  mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/xxxx/public_html/xxxxx/Sources/Subs-Db-mysql.php on line 132

Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

kat

I have a hunch about that last error...

Does your host still use v4 of PHP?

DarkAngel612

Quote from: K@ on March 30, 2012, 05:13:29 AM
I have a hunch about that last error...

Does your host still use v4 of PHP?


Nope

PHP version5.2.17
MySQL version5.0.95-community
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

kat

In your copy of the file, is line 132 this?

return sprintf('\'%1$s\'', mysql_real_escape_string($replacement, $connection));

DarkAngel612

Quote from: K@ on March 31, 2012, 09:52:52 AM
In your copy of the file, is line 132 this?

         return sprintf('\'%1$s\'', mysql_real_escape_string($replacement, $connection));



First your answer...lol   Yes it is

I have also noticed that this forum with its problems is the only one to have them. The others have the exact same files in sources but the errors are not in them.

I keep getting undefined index this or that or undefined text days apart but usually with the subs-post file

so far this one:

[30-Mar-2012 18:01:04] PHP Warning:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: invalid UTF-8 string at offset 8 in /home/xxxx/public_html/xxx/Sources/Subs-Post.php on line 1279

has not returned yet...I compared the code from the 2.0.2 file:

// Convert all 'special' characters to HTML entities.
        return array($charset, preg_replace('~([\x80-' . ($context['server']['complex_preg_chars'] ? '\x{10FFFF}' : "\xF7\xBF\xBF\xBF") . '])~eu', '$entityConvert(\'\1\')', $string), '7bit');
    }


to the this one

// Convert all 'special' characters to HTML entities.
        return array($charset, preg_replace('~([\x80-' . ($context['server']['complex_preg_chars'] ? '\x{10FFFF}' : pack('C*', 0xF7, 0xBF, 0xBF, 0xBF)) . '])~eu', '$entityConvert(\'\1\')', $string), '7bit');
    }


the part being in red as the difference...I changed my file on the server to it and the error has not come back...yet

while writing this I scoured the files and I guess I got lost in folders...that code came from 1.1.9 version file...I hope I did not hurt anything with the edit I did to remove the 2.0.2 code and replace with that one.

Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

kat


DarkAngel612

Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

kat

WoOt!

Tell ya what. I'll mark this "Solved", right now.

DARE it to return.... ;)

DarkAngel612

#19
it took you up on the dare.....GRRRR

I have no troubles sending --- getting emails nor notifications to folks but that darn subs one for the mysql file in sources is procreating proficiently right now along with a couple of new ones...



PHP Warning:  mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource in /home/thefanta/public_html/attic/Sources/Subs-Db-mysql.php on line 368

PHP Warning:  mysql_error(): supplied argument is not a valid MySQL-Link resource in Sources/Subs-Db-mysql.php on line 414

PHP Warning:  mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/thefanta/public_html/attic/Sources/Subs-Db-mysql.php on line 415

PHP Warning:  mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /Sources/Subs-Db-mysql.php on line 132

PHP Fatal error:  Cannot use string offset as an array in Themes/default/Wireless.template.php on line 1516



the only errors in the admin side of the forum are just general alerts of spammers attempting to access but access is denied them.

so the one for the subs-post file is behaving but still the other one lingers.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Advertisement: