Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7722755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:16:05+00:00 2026-06-01T04:16:05+00:00

I don’t think my code’s the problem because it’s working on my local server

  • 0

I don’t think my code’s the problem because it’s working on my local server (EDIT: sorry if this was the wrong place to ask, but I can’t move to ServerFault by myself). On the remote server, though, I can’t get mysql_real_escape_string() to work. The database connection is working, and I’m connecting before calling the function.

When I try echo $_POST['email'];, I get the right data, but when I try echo mysql_real_escape_string($_POST['email']); I get nothing.

Here’s I get when I leave error reporting on:

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: [2002] No such file or directory (trying to connect via unix://please_see_the_faq) in /f5/mysite/public/email_results.php on line 11

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: No such file or directory in /f5/mysite/public/email_results.php on line 11

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /f5/mysite/public/email_results.php on line 11

Is it possible that something with the PHP configuration is causing this? I’m hosting with NearlyFreeSpeech, if it matters.

Here’s my insert code:

$db->query('INSERT INTO emails VALUES ("sampleemail@gmail.com")');

And here’s how I’m connecting to the database:

@ $db = new mysqli('mysite.db', 'wizard', '(password)', 'mysite');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:16:06+00:00Added an answer on June 1, 2026 at 4:16 am

    You see that first error…the one saying “trying to connect via unix://please_see_the_faq“? That means PHP is trying to connect to your MySQL server (the same as it would via mysql_connect with no params), but it doesn’t have the correct params to connect. It doesn’t even know where the database socket is.

    If you’re not connecting to the database using mysql_connect, then you shouldn’t be using mysql_real_escape_string. If you do, then it’ll try to connect to the database on its own, using the default params in php.ini (the results of which, you’re currently seeing). It looks like you’re using mysqli, which is a whole different extension, and has its own escape function — mysqli_real_escape_string. Use that instead.

    Or, get a clue and learn to use prepared statements as the gods intended.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't know if this is the right place to ask this, but I will
Don't think my virtualhost is working correctly. This is what I have inside of
Don't ask me why but i can't use this method because I need to
Don't think this is a repost, difficult to search for the word between because
Don't be scared of the extensive code. The problem is general. I just provided
Don't know if this is an eclipse specific problem but whenever I declare a
Don't think there's much to say, here's my code for (int i = 0;
Don't let below code scare you away . The question is really simple, only
Don't dismiss this as a newbie question! It's not, I'm not, I've tried everything,
Don't ask me why but I need to do the following: string ClassName =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.