Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-23-2004, 12:42 AM   PM User | #1
Taipan
New Coder

 
Join Date: Mar 2004
Posts: 95
Thanks: 8
Thanked 0 Times in 0 Posts
Taipan is an unknown quantity at this point
Moved my pages and now I get errors

Hi,

I was testing some pages I was writing on my own site and mysql database before moving it to the final site. They work fine on my site but now that I have moved it and transfer the sql over I am getting some errors.

PHP Code:
// Function for escaping and trimming form data.
function escape_data ($data) {
        global 
$dbc// Need the connection.
        
if (ini_get('magic_quotes_gpc')) {
                
$data stripslashes($data);
        }
        return 
mysql_real_escape_string (trim ($data), $dbc);
// End of function. 
This function is in the page with all the database connection information, mysql_connect.php

I am getting this error when my page tries to add or update to the database.

Fatal error: Call to undefined function: mysql_real_escape_string() in /home/share/website.net/www.websitei.net/public_html/mysql_connect.php on line 41

Hopefully someone can tell me why this happens.
Taipan is offline   Reply With Quote
Old 03-23-2004, 12:47 AM   PM User | #2
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
Have you moved to a different server? You may be using a different php version?
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 03-23-2004, 12:48 AM   PM User | #3
Taipan
New Coder

 
Join Date: Mar 2004
Posts: 95
Thanks: 8
Thanked 0 Times in 0 Posts
Taipan is an unknown quantity at this point
Yes, it has moved to a different server. As I am a newbie ... how can I work around this?
Taipan is offline   Reply With Quote
Old 03-23-2004, 12:54 AM   PM User | #4
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
Not sure really, might be something for you in the manual http://uk.php.net/mysql_real_escape_string
Just been thinking (yeah, it's a rare thing I do ) maybe you could use str_replace to put a backslash infront of special characters?
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks

Last edited by Nightfire; 03-23-2004 at 01:00 AM..
Nightfire is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:36 AM.


Advertisement
Log in to turn off these ads.