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

  • Home
  • SEARCH
  • 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 8253325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:50:30+00:00 2026-06-08T00:50:30+00:00

MYSQL Problem inserting Certain type of Text when i try to insert this for

  • 0

MYSQL Problem inserting Certain type of Text

when i try to insert this for example:

INSERT INTO `Attacks_key` 
  (`Event_Key` ,`Variable` ,`Value` ,`Impact` ,`Tags`)
    VALUES 
  ('111', 'REQUEST', ' mysql_real_escape ', '222', 'xss, csrf, id, rfe, lfi');

its inserted But when I try to insert this :

INSERT INTO `Attacks_key` 
 (`Event_Key` ,`Variable` ,`Value` ,`Impact` ,`Tags`) 
   VALUES 
 ('111', 'REQUEST', 'mysql_real_escape_string($_POST['username']); ', '222', 'xss, csrf, id, rfe, lfi');

MYSQL display this message :

#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘username’]); ‘, ‘222’, ‘xss, csrf, id, rfe, lfi’)’ at line 1

and this is my php code

$user="root";
$password="*";
$database="*";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$sql = "SELECT `Key_id` FROM `Event` ORDER BY `Key_id` DESC LIMIT 1";
$result =mysql_query($sql);
$row = mysql_fetch_assoc($result);
$EventKey= $row['Key_id'];
$query="INSERT INTO `PHPLOGS`.`Attacks_key` (`Event_Key` ,`Variable` ,`Value` ,`Impact` ,`Tags`) VALUES ('$EventKey', '$getname', '$getvalue', '$getimpec', '$gettags');";
mysql_query($query);
mysql_close();

and the input ‘mysql_real_escape_string($_POST[‘username’]); from the user

Can someone help

thanks

  • 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-08T00:50:32+00:00Added an answer on June 8, 2026 at 12:50 am

    If you’re inserting mysql_real_escape_string($_POST['username']); literally, then escape the single quotes.

    INSERT INTO `Attacks_key` 
     (`Event_Key` ,`Variable` ,`Value` ,`Impact` ,`Tags`) 
       VALUES 
     ('111', 'REQUEST', 'mysql_real_escape_string($_POST[\'username\']); ', '222', 'xss, csrf, id, rfe, lfi');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem in inserting the listbox value into mysql database in vb
i have a problem in inserting the listbox value into mysql database in vb
The problem is with inserting json strings into MySQL database. In my python program
I have encountered a problem while inserting a large amounts of text into my
I am having a very strange problem inserting values into my mysql database, using
I have a problem in mysql. I need to fetch certain sets of records
This is a query that is executed without problem with MySql 5.0.51: SELECT cc_split.idSplit,
Table in MySQL have 1 problem column: creation_date . During inserting a new row
I am using mysql_real_escape_string function while inserting the data into MySQL database. I am
I think most people had serious problems with inserting a value/data into a database

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.