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 7091979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:15:19+00:00 2026-05-28T08:15:19+00:00

I am writing a little PHP-MySQL interface — However, when I try to escape

  • 0

I am writing a little PHP-MySQL interface — However, when I try to escape strings using mysql_real_escape, they are getting wiped blank!

Let’s say we have a PHP file at the url

http://web/file.php

The contents of this file are:

echo $_GET["action"];
echo  mysql_real_escape_string($_GET["action"]);

Now, let’s say we load the url:

http://web/file.php?action=asdfqwerty

The FIRST echo will output “asdfqwerty”.

However, the second one outputs nothing at all! I’m not sure why this is… Can anyone help out? Thankyou!

  • 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-05-28T08:15:20+00:00Added an answer on May 28, 2026 at 8:15 am

    As documented here, mysql_real_escape_string needs an open database connection. If none exists, an error occurs. You seem to have your PHP configured to not output errors, so you can’t see this. You can verify it by using a higher error level:

    <?php
    error_reporting(E_ALL);
    echo $_GET["action"];
    echo  mysql_real_escape_string($_GET["action"]);
    

    Or by adapting your php.ini.

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

Sidebar

Related Questions

I am writing a simple php registration page using MySQL as the database. I
I am writing a little web app for ocean tides using PHP. I am
This is my first question :). Im writing a little twitter app in PHP
I'm writing a simple templating layer in PHP but I've got myself a little
I'm a little new at PHP, so my script writing is still progressing. I
I'm writing my first little AJAX-enabled Joomla component. I'm using mootools. I got a
So, I'm writing a game engine. I have a little example (see http://qrcode.kaywa.com/img.php?s=8&d=http://rokonandroid.com/rd.apk ),
I'm writing a little bit of PHP, but Im a serious nOOb. I want
Ok, so a little while back I had some help writing some PHP voting
I'm relatively new to PHP and have been writing a project using what I

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.