VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Quality & Testing VirtueMart 1.1.x => Virtuemart 1.1 Development (Archiv) => Q&T Resolved => Topic started by: jenkinhill on January 13, 2008, 13:27:37 PM

Title: [FIXED] MySQL warning 1155 on J1.5 with PHP4
Post by: jenkinhill on January 13, 2008, 13:27:37 PM
Error message appears on loading of admin panel:

Warning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in /var/www/html/joomla3/libraries/joomla/database/database/mysql.php on line 193

Database Version: 4.1.22
PHP Version:      4.4.4
Web Server: Apache
VirtueMart 1.1: Ver. 1155
Joomla! Version: Joomla! 1.5 Beta4+ Rev 9909 2008-01-08

No error message with PHP 5.2.4

[attachment cleanup by admin]
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: jenkinhill on January 22, 2008, 17:43:01 PM
Still get the same error message with VM1175 - now on J1.5 final.
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: aravot on January 23, 2008, 21:02:08 PM
You are on you own unless Gurus step in, I can't replicate that on any of my servers even local.
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: jenkinhill on January 24, 2008, 00:20:55 AM
Only happens with PHP4 for me. A ggogle on the error throws up a lot of similar warnings on a variety of sites.

This one is interesting - but not helpful:  http://forum.joomla.org/index.php/topic,215561.0.html
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: Michael Thomsen on January 24, 2008, 00:28:25 AM
this is the same problem I am having on a server with this configuration:

UPDATE: the configuration below is from the cpanel, however when checking the PHP version from within the Joomla admin panel it states the PHP version to be  4.4.6, so perhaps it is just a PHP 4 related problem.


Operating system     Linux
Kernel version    2.6.9-55.0.9.ELsmp
Machine Type    i686
Apache version    1.3.37 (Unix)
PERL version    5.8.7
PHP version    5.2.1
MySQL version    5.0.27-standard

cheers
Michael
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: jenkinhill on January 24, 2008, 09:48:43 AM
Quote from: Michael Thomsen on January 24, 2008, 00:28:25 AM
perhaps it is just a PHP 4 related problem.
Yes, I don't see it with PHP5
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: rrommel on January 24, 2008, 23:32:39 PM
I also got the same error with a new site I'm working on (joomla 1.5 stable = vm 1.1 beta 1185)

My isp have both php 4 and php5 installed on their server. Get this error because php4 is used in default. Solved the problem by adding: "SetEnv DEFAULT_PHP_VERSION 5 " in.htaccess
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: MoonWizard on January 25, 2008, 02:08:41 AM
Using joomla 1.5 stable = vm 1.1 beta 1186 and still can see the error:

Warning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in /home/hblincom/public_html/*****/libraries/joomla/database/database/mysql.php on line 193

Fresh install.

By the way, I have written into my htaccess "SetEnv DEFAULT_PHP_VERSION 5" and I haven't noticed any change.

It's a bit confusing to have the virtuemart admin menu like a list...

Just trying to help, really nice work.
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: gregdev on January 25, 2008, 08:28:50 AM
I can see it on PHP4. I'll look at it (unless someone else gets to it first).

Greg
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: jenkinhill on January 25, 2008, 10:25:46 AM
Quote from: MoonWizard on January 25, 2008, 02:08:41 AM
It's a bit confusing to have the virtuemart admin menu like a list..

CHMOD the VM component files, back and frontend to 644 - with current compilations the files will have 777 permissions. That fixes the list type menu and allows me to run VM, as my server security will not allow PHP files to run if they are set to 777.
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: MoonWizard on January 25, 2008, 11:16:37 AM
Thank you Kelvyn, I have noticed this subject has been solved here: http://forum.virtuemart.net/index.php?topic=35395.0

By the way... now this admin area ROCKS!!!!

Just returning to the previous problem, I still can see the

Warning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in /home/hblincom/public_html/hbeuropa/libraries/joomla/database/database/mysql.php on line 193

After the change.

Just trying to help... my knowledge of programming is limted.

Thanks for this great great component :-)

Quote from: jenkinhill on January 25, 2008, 10:25:46 AM
Quote from: MoonWizard on January 25, 2008, 02:08:41 AM
It's a bit confusing to have the virtuemart admin menu like a list..

CHMOD the VM component files, back and frontend to 644 - with current compilations the files will have 777 permissions. That fixes the list type menu and allows me to run VM, as my server security will not allow PHP files to run if they are set to 777.
Title: Re: MySQL warning 1155 on J1.5 with PHP4
Post by: rrommel on January 25, 2008, 15:38:20 PM
Hi Moonwizard,

I think you should check which php version is installed on your server. If your server has both php 4 and php 5 installed like mine than you can add "SetEnv DEFAULT_PHP_VERSION 5 " in .htaccess
If your server only has php4 than adding this line will not solved your problem.

Quote
Re: MySQL warning 1155 on J1.5 with PHP4
« Reply #10 on: Today at 11:16:37 »
   Reply with quote
Thank you Kelvyn, I have noticed this subject has been solved here: http://forum.virtuemart.net/index.php?topic=35395.0

By the way... now this admin area ROCKS!!!!

Just returning to the previous problem, I still can see the

Warning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in /home/hblincom/public_html/hbeuropa/libraries/joomla/database/database/mysql.php on line 193

I didn't see this warning again after adding this line in .htaccess (it's the first line in my .htaccess)
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: aravot on January 25, 2008, 22:54:12 PM
Please try build 1189
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: MoonWizard on January 26, 2008, 00:01:53 AM
I have a fresh install of Joomla 1.5 stable, and I host my website in Hostgator (php 4 and 5 available).

I have removed last version and installed the new one: the 1189 version.

With PHP version: 4.4.4, I still can see the warning message:

Warning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in /home/*****/public_html/*****/libraries/joomla/database/database/mysql.php on line 193

And I can't see the virtuemart admin area correctly (still the list).



Then I have added to my .htaccess the next line for changing php version:
AddHandler application/x-httpd-php5 .php

And now the problem has disappeared and the admin section looks great!

Is there any problem running the site in this version?

Thank you very much!
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: aravot on January 26, 2008, 08:04:33 AM
The following error is still present in VM 1.1 rev 1189 when legacy plugin if off/unpublished, publishing legacy plugin the error goes away.

QuoteWarning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in /home/example.com/public_html/libraries/joomla/database/database/mysql.php on line 193

Tested server info:
PHP Built on: Linux pollux.lunarmania.com 2.6.9-55.0.12.ELsmp #1 SMP Fri Nov 2 11:19:08 EDT 2007 i686
Database Version: 5.0.27-standard
Database Collation: utf8_general_ci
PHP Version: 4.4.7
Web Server: Apache/1.3.39 (Unix) Sun-ONE-ASP/4.0.2 mod_fastcgi/2.4.6 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 mod_ssl/2.8.30 OpenSSL/0.9.7a
Web Server to PHP interface: cgi
Joomla! Version: Joomla! 1.5.0 Production/Stable
User Agent: Opera/9.25 (Windows NT 5.1; U; en)

Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: mtk on January 26, 2008, 11:41:32 AM
Quote from: aravot on January 26, 2008, 08:04:33 AM
The following error is still present in VM 1.1 rev 1189 when legacy plugin if off/unpublished, publishing legacy plugin the error goes away.

QuoteWarning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in /home/example.com/public_html/libraries/joomla/database/database/mysql.php on line 193
Good, this is confirmed (both front / back ends)

Now only to fix with Legacy OFF


in my case it's

DB: 5.0.27-standard
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: Ronal on January 26, 2008, 11:57:52 AM
VM 1.1 is positioned as completely compatible to Joomla 1.5. This warning will be solved or it is necessary to publish legacy plug-in?
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: mtk on January 26, 2008, 12:09:39 PM
Quote from: Ronal on January 26, 2008, 11:57:52 AM
VM 1.1 is positioned as completely compatible to Joomla 1.5. This warning will be solved or it is necessary to publish legacy plug-in?
VM 1.1 is NOT final yet, this is the time to offer help & not demand for answer...
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: Ronal on January 26, 2008, 12:25:22 PM
Quote from: mtk on January 26, 2008, 12:09:39 PM
VM 1.1 is NOT final yet, this is the time to offer help & not demand for answer...
Fully agree. Best regards to developers.
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: gregdev on January 26, 2008, 16:48:04 PM
This should be fixed in rev. 1192. Please test.

Greg
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: MoonWizard on January 26, 2008, 18:49:48 PM
Removed last version, installed VirtueMart 1.1 revision 1192. Using 1.5 stable.

Error message dissapeared  :) with php 4.4.4 and NO legacy mode.

But I still see, the menu as a list. If I activate legacy mode, I still can see the menu exactly the same.

Hope this helps.

Nice work!
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: jenkinhill on January 26, 2008, 19:54:15 PM
Quote from: MoonWizard on January 26, 2008, 18:49:48 PM
But I still see, the menu as a list. If I activate legacy mode, I still can see the menu exactly the same.

Have you tried changing the VM component file permissions? CHMOD back anf frontend VM component files to 644. That should fix the menu.
Title: Re: [KNOWN ISSUE] MySQL warning 1155 on J1.5 with PHP4
Post by: aravot on January 26, 2008, 20:46:39 PM
Fixed in build 1192