[PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread Paul Hickey
Can someone help me overcome this recurring problem? I am using the
Joomla content management system and I keep coming across the following
errors.  

Fatal error: Call to undefined function mysql_real_escape_string()
in /usr/local/apache2/htdocs/common.php on line 24

Fatal error: Call to undefined function mysql_real_escape_string()
in /usr/local/apache2/htdocs/class.inputfilter.php on line 344

I notice in my Dynamic Extensions section of php.ini there are no
extensions called for; if that helps. Joomla works fine, but when adding
components or modules the problems start. One component author made a
test for the mysql_real_escape_string and I think avoided using it then
the component worked. I think that's probably not the best solution. 

Fedora Core 3

Apache 2.0.55

PHP 5.0.5 (compiled with mysqli vice mysql)
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp'
'--enable-inline-optimization' '--enable-magic-quotes' '--enable-
mbstring' '--enable-track-vars' '--enable-trans-sid' '--enable-
wddx=shared' '--enable-xml' '--with-dom' '--with-gd' '--with-gettext'
'--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-regex=system'
'--with-xml' '--with-zlib-dir=/usr/lib'

MySQL 4.1.15


TIA,


Paul Hickey
Christian Patriot 
Palm Bay Fl

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread David Grant
Try using mysqli, instead of mysql.

Have you tried Joomla! support channels?

Paul Hickey wrote:
 Can someone help me overcome this recurring problem? I am using the
 Joomla content management system and I keep coming across the following
 errors.  
 
 Fatal error: Call to undefined function mysql_real_escape_string()
 in /usr/local/apache2/htdocs/common.php on line 24
 
 Fatal error: Call to undefined function mysql_real_escape_string()
 in /usr/local/apache2/htdocs/class.inputfilter.php on line 344
 
 I notice in my Dynamic Extensions section of php.ini there are no
 extensions called for; if that helps. Joomla works fine, but when adding
 components or modules the problems start. One component author made a
 test for the mysql_real_escape_string and I think avoided using it then
 the component worked. I think that's probably not the best solution. 
 
 Fedora Core 3
 
 Apache 2.0.55
 
 PHP 5.0.5 (compiled with mysqli vice mysql)
 './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp'
 '--enable-inline-optimization' '--enable-magic-quotes' '--enable-
 mbstring' '--enable-track-vars' '--enable-trans-sid' '--enable-
 wddx=shared' '--enable-xml' '--with-dom' '--with-gd' '--with-gettext'
 '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-regex=system'
 '--with-xml' '--with-zlib-dir=/usr/lib'
 
 MySQL 4.1.15
 
 
 TIA,
 
 
 Paul Hickey
 Christian Patriot 
 Palm Bay Fl
 


-- 
David Grant
http://www.grant.org.uk/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread Paul Hickey
I have PHP compiled with mysqli.

The standard answer from the Joomla forums is that I need to have
mysql vice mysqli. I was looking for a more global solution than
having to modify the code for every component, module, mambot I want to
use.

I don't understand why I'm getting undefined function errors. 

PHP.ini has no reference to mysqli. I don't know if changing this would
enable the functions specific to PHP  4.x.

Paul Hickey
Christian Patriot 
Palm Bay Fl

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread David Grant
Is there no way to specify the database functions in Joomla?

You're getting undefined function because you haven't compiled it with
mysql, but mysqli instead, which means the functions you need are
prefixed with mysqli instead of mysql.

Paul Hickey wrote:
 I have PHP compiled with mysqli.
 
 The standard answer from the Joomla forums is that I need to have
 mysql vice mysqli. I was looking for a more global solution than
 having to modify the code for every component, module, mambot I want to
 use.
 
 I don't understand why I'm getting undefined function errors. 
 
 PHP.ini has no reference to mysqli. I don't know if changing this would
 enable the functions specific to PHP  4.x.
 
 Paul Hickey
 Christian Patriot 
 Palm Bay Fl
 


-- 
David Grant
http://www.grant.org.uk/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread John Nichel

Paul Hickey wrote:

Can someone help me overcome this recurring problem? I am using the
Joomla content management system and I keep coming across the following
errors.  


Fatal error: Call to undefined function mysql_real_escape_string()
in /usr/local/apache2/htdocs/common.php on line 24

Fatal error: Call to undefined function mysql_real_escape_string()
in /usr/local/apache2/htdocs/class.inputfilter.php on line 344

I notice in my Dynamic Extensions section of php.ini there are no
extensions called for; if that helps. Joomla works fine, but when adding
components or modules the problems start. One component author made a
test for the mysql_real_escape_string and I think avoided using it then
the component worked. I think that's probably not the best solution. 


Fedora Core 3

Apache 2.0.55

PHP 5.0.5 (compiled with mysqli vice mysql)
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp'
'--enable-inline-optimization' '--enable-magic-quotes' '--enable-
mbstring' '--enable-track-vars' '--enable-trans-sid' '--enable-
wddx=shared' '--enable-xml' '--with-dom' '--with-gd' '--with-gettext'
'--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-regex=system'
'--with-xml' '--with-zlib-dir=/usr/lib'

MySQL 4.1.15


I'm pretty sure this was answered yesterday...oh yeah, it was.  ;)

http://marc.theaimsgroup.com/?l=php-generalm=113397347124908w=2

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread John Nichel

Paul Hickey wrote:

I have PHP compiled with mysqli.

The standard answer from the Joomla forums is that I need to have
mysql vice mysqli. I was looking for a more global solution than
having to modify the code for every component, module, mambot I want to
use.

I don't understand why I'm getting undefined function errors. 


PHP.ini has no reference to mysqli. I don't know if changing this would
enable the functions specific to PHP  4.x.


In your configuration line (how php was configured then compiled), you 
have...


--with-mysqli=/usr/local/mysql/bin/mysql_config

That is why you are getting undefined function errors.  Your version of 
php is using mysqli, not mysql.  You have two options: a) Recompile php 
or b) Change all mysql_* functions to their counterparts in mysqli_*



--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread David Grant
Hi John,

John Nichel wrote:
 Paul Hickey wrote:
 I don't understand why I'm getting undefined function errors.
 PHP.ini has no reference to mysqli. I don't know if changing this would
 enable the functions specific to PHP  4.x.
 
 In your configuration line (how php was configured then compiled), you
 have...
 
 --with-mysqli=/usr/local/mysql/bin/mysql_config
 
 That is why you are getting undefined function errors.  Your version of
 php is using mysqli, not mysql.  You have two options: a) Recompile php
 or b) Change all mysql_* functions to their counterparts in mysqli_*


Hmm, that's how I *should* have put it. :)

Cheers,

David
-- 
David Grant
http://www.grant.org.uk/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread Curt Zirzow
On Thu, Dec 08, 2005 at 08:32:56AM -0500, Paul Hickey wrote:
 I have PHP compiled with mysqli.
 
 The standard answer from the Joomla forums is that I need to have
 mysql vice mysqli. I was looking for a more global solution than
 having to modify the code for every component, module, mambot I want to
 use.

Well there is a rather global solution, but will require some work.
You would have to create a wrapper for all mysql* calls to use
mysqli, so for example:

?php
if( !function_exists('mysql_connect') 
function_exists('mysqli_real_connect') ) {

  function mysql_connect($server, $username, $password) {
gobal $_mysql_mysqli_dbh_;
$_mysql_mysqli_dbh_ = mysqli_init();

return mysqli_real_connect($_mysql_mysqli_dbh_, $server, $username, 
$password);
  }

  function mysql_real_escape_string($string, $dbh=false) {

if($dbh === $false) {
  gobal $_mysql_mysqli_dbh_;
  $dbh = $_mysql_mysqli_dbh_;
}

return mysqli_real_escape_string($dbh, $string);
  }
  // any other interface needed.

}
?


I've been meaning to write something like this for the
Pear::PHP_Compat tool, it could help upgrading all your scripts to
mysqli interface, not to mention upgrading to php5.1


Curt.
-- 
cat .signature: No such file or directory

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Call to undefined function mysql_real_escape_string()

2005-12-07 Thread Paul Hickey




Can someone help me overcome this recurring problem? I am using the Joomla content management system and I keep coming across the following errors. 

Fatal error: Call to undefined function mysql_real_escape_string() in /usr/local/apache2/htdocs/common.php on line 24

Fatal error: Call to undefined function mysql_real_escape_string() in /usr/local/apache2/htdocs/class.inputfilter.php on line 344

I notice in my Dynamic Extensions section of php.ini there are no extensions called for; if that helps. Joomla works fine, but when adding components or modules the problems start. One component author made a test for the mysql_real_escape_string and I think avoided using it then the component worked. I think that's probably not the best solution. 

Fedora Core 3

Apache 2.0.55

PHP 5.0.5 (compiled with mysqli vice mysql)
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp' '--enable-inline-optimization' '--enable-magic-quotes' '--enable-mbstring' '--enable-track-vars' '--enable-trans-sid' '--enable-wddx=shared' '--enable-xml' '--with-dom' '--with-gd' '--with-gettext' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-regex=system' '--with-xml' '--with-zlib-dir=/usr/lib'

MySQL 4.1.15


TIA,





Paul Hickey
Christian Patriot 
Palm Bay Fl











Re: [PHP] Call to undefined function mysql_real_escape_string()

2005-12-07 Thread John Nichel

Paul Hickey wrote:
Can someone help me overcome this recurring problem? I am using the 
Joomla content management system and I keep coming across the following 
errors. 

Fatal error: Call to undefined function mysql_real_escape_string() in 
/usr/local/apache2/htdocs/common.php on line 24


Fatal error: Call to undefined function mysql_real_escape_string() in 
/usr/local/apache2/htdocs/class.inputfilter.php on line 344


I notice in my Dynamic Extensions section of php.ini there are no 
extensions called for; if that helps. Joomla works fine, but when adding 
components or modules the problems start. One component author made a 
test for the mysql_real_escape_string and I think avoided using it then 
the component worked. I think that's probably not the best solution.


Fedora Core 3

Apache 2.0.55

PHP 5.0.5 (compiled with mysqli vice mysql)
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp' 
'--enable-inline-optimization' '--enable-magic-quotes' 
'--enable-mbstring' '--enable-track-vars' '--enable-trans-sid' 
'--enable-wddx=shared' '--enable-xml' '--with-dom' '--with-gd' 
'--with-gettext' '--with-mysqli=/usr/local/mysql/bin/mysql_config' 
'--with-regex=system' '--with-xml' '--with-zlib-dir=/usr/lib'


MySQL 4.1.15


mysql_real_escape_string() is a MySQL function, and you're server is 
compiled with the 'improved' MySQL functions.  You want 
mysqli_real_escape_string()


http://us3.php.net/manual/en/function.mysqli-real-escape-string.php

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php