473,396 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

mysql_real_escape_string() undefined?

Hi!,

I am using PHP/MySQL on RH Linux 8.0 with these RPMs installed:

php-4.2.2-8.0.5
asp2php-0.76.2-3
php-pgsql-4.2.2-8.0.5
php-dbg-server-2.10pl3-6
php-ldap-4.2.2-8.0.5
php-dbg-base-2.10-4
php-mysql-4.2.2-8.0.5
php-devel-4.2.2-8.0.5
php-snmp-4.2.2-8.0.5
php-dbg-client-2.10-6
php-imap-4.2.2-8.0.5
php-odbc-4.2.2-8.0.5

I get this error from a PHP script calling mysql_real_escape_string():

---

Fatal error: Call to undefined function: mysql_real_escape_string() in
/var/www/thenewagesite/jjdewey/archives/insert.php on line 26

---
On first looking around the web I thought perhaps I needed to compile
PHP to use MySQL, but per the PHP documentation (see URL below):

"As of PHP 4, --with-mysql is enabled by default so to disable MySQL
support you must use --without-mysql."

http://www.php.net/manual/en/ref.mysql.php

From the installed RPM's above it looks like I shouldn't have to
compile? Also in my script I call other mysql functions before calling
this and those don't fail, for example I call mysql_connect() which
doesn't return an error. Also the same code works fine when I run it
using PHP/MySQL on Windows. This is only failing on RH Linux 8.0 (a
new install).

Any ideas,or pointers (or FAQs that I've missed)??

Thanks!,

Lawrence Kennon
Jul 16 '05 #1
1 11181
Aquarius2431 wrote:
php-4.2.2-8.0.5 Any ideas,or pointers (or FAQs that I've missed)??


Just the API docs:
http://www.php.net/manual/en/functio...ape-string.php
(PHP 4 >= 4.3.0)

use mysql_escape_string() instead.
--
----- stephan beal
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.

Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: leegold2 | last post by:
When I look directly in my db field I see a difference between these two functions. The top line (seebelow) was inserted with addslashes vs. the bottom line where I used mysql_real_escape_string....
1
by: Michael G | last post by:
If I only escape the characters that mysql_real_escape_string recognizes, is this adequate protection against SQL injection attacks? I have read a number of archived posts plus I've read some of...
2
by: Marcus | last post by:
Hello, My php.ini file currently has magic quotes set to On, but I have read that it is better to code with it off. Currently with magic quotes on, I only use stripslashes() to properly...
2
by: comp.lang.php | last post by:
when trying to use the mysql_real_escape_string() function, the following warning occurs: First of all, the user is not 'web' trying to connect to the database, secondly, what is...
2
by: matthud | last post by:
<?php //MAKE IT SAFE $chunk = $_POST; $title = $_POST; $url = $_POST; $tags = $_POST; $user = $_POST; $safe_chunk = mysql_real_escape_string(htmlentities($chunk)); $safe_title =...
11
by: zach | last post by:
I created a comment form which will inserts the comments into a database and displays them immediately. I want to make sure that its safe from users inserting unwanted data into the database or...
2
by: Pugi! | last post by:
It is by accident that I noticed that I forgot to use mysql_real_escape_string in part of my webapp. I tested input with following text : Hélène 51°56'12'' http://www.mysite.org/folder 3 functions...
13
by: ndlarsen | last post by:
Hello. It's been a while since I used php. Since then magic quotes has been deprecated and will be removed when php 6.0 hits. My question is, what should I be using when submitting data to a...
7
by: roseple | last post by:
Hi, can anyone please help me why I got this error every I uploaded files. Error: Here is the code on the said warning message: # Gather all required data $name =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.