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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:37:44+00:00 2026-06-15T13:37:44+00:00

Solved previous part of problem, still need to understand why this isn’t working though

  • 0

Solved previous part of problem, still need to understand why this isn’t working though 🙂

Reverting back to escaping the strings separately, I have this.

    mysql_query("INSERT INTO users (firstname,surname,email,password,birthday,birthmonth,birthyear,houseno,streetname,town,country,postcode,phonenumber,singer,songwriter,producer,composer,band,instrument,instrument2,extra,confirmcode) VALUES ('".$firstname."','".$surname."','".$email."','".$password."',".$birthday.",".$birthmonth.",".$birthyear.",'".$houseno."','".$streetname."','".$town."','".$country."','".$postcode."',".$phonenumber.",".$singer.",".$songwriter.",".$producer.",".$composer.", ".$band.",'".$instrument."','".$instrument2."','".$extra."','".$rand."')",
    mysql_real_escape_string($surname),
    mysql_real_escape_string($firstname),
    mysql_real_escape_string($stown),
    mysql_real_escape_string($houseno),
    mysql_real_escape_string($streetname),
    mysql_real_escape_string($extra),
    mysql_real_escape_string($email)) or die ('pood'); 
    echo $streetname;

I’m getting the die error – so it doesn’t echo $streetname; (which should be ‘Clark\’s Way’), and doesn’t seem to backslash apostrophe as it’s not being entered into the database.

Apologies if I haven’t done my research to your standards, but I’ve been trying to understand why this isn’t working for hours.

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-15T13:37:45+00:00Added an answer on June 15, 2026 at 1:37 pm

    mysql_query() doesn’t take multiple arguments like that. You need to escape each variable within the string of the query. Like this:

    ... VALUES ('".mysql_real_escape_string($firstname)."','".mysql_r...
    

    So, you’d end up with something like this:

    $query = "INSERT INTO users (firstname,surname,email,password,birthday,
    birthmonth,birthyear,houseno,streetname,town,country,postcode,
    phonenumber,singer,songwriter,producer,composer,band,instrument,
    instrument2,extra,confirmcode) VALUES (
    '". mysql_real_escape_string($firstname) ."',
    '". mysql_real_escape_string($surname) ."',
    '". mysql_real_escape_string($email) ."',
    '". mysql_real_escape_string($password) ."',
    '". mysql_real_escape_string($birthday) ."',
    '". mysql_real_escape_string($birthmonth) ."',
    '". mysql_real_escape_string($birthyear) ."',
    '". mysql_real_escape_string($houseno) ."',
    '". mysql_real_escape_string($streetname) ."',
    '". mysql_real_escape_string($town) ."',
    '". mysql_real_escape_string($country) ."',
    '". mysql_real_escape_string($postcode) ."',
    '". mysql_real_escape_string($phonenumber) ."',
    '". mysql_real_escape_string($singer) ."',
    '". mysql_real_escape_string($songwriter) ."',
    '". mysql_real_escape_string($producer) ."',
    '". mysql_real_escape_string($composer) ."',
    '". mysql_real_escape_string($band) ."',
    '". mysql_real_escape_string($instrument) ."',
    '". mysql_real_escape_string($instrument2) ."',
    '". mysql_real_escape_string($extra) ."',
    '". mysql_real_escape_string($rand) ."')";
    
    mysql_query($query) or die (mysql_error()); 
    

    Sorry if there’s a typo in there. But I think you get the idea.


    Here’s an (untested) example of how a parameterized query might work, adapted from the examples in the manual:

    $query = "INSERT INTO users (firstname,surname,email,password,birthday,
    birthmonth,birthyear,houseno,streetname,town,country,postcode,
    phonenumber,singer,songwriter,producer,composer,band,instrument,
    instrument2,extra,confirmcode) VALUES (
    :firstname, :surname, :email, :password, :birthday, :birthmonth,
    :birthyear, :houseno, :streetname, :town, :country, :postcode, :phonenumber,
    :singer, :songwriter, :producer, :composer, :band, :instrument, :instrument2,
    :extra, :rand)";
    
    // assume $dbh is your PDO database connection
    $sth = $dbh->prepare($query);
    $sth->bindParam(':firstname', $firstname);
    $sth->bindParam(':surname', $surname);
    $sth->bindParam(':email', $email);
    $sth->bindParam(':password', $password);
    $sth->bindParam(':birthday', $birthday);
    // and so on...
    
    $sth->execute();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Spent the good part of this morning working through this, but still…. apologies if
Right, I solved my previous problem of not being able to submit the textarea
Ok after my previous post, i have made some progress, yet still i need
This is a followup to my previous question , which got solved (thank you
I've solved my previos problem of converting XML RSA private key to PEM file,
@Solved The two subquestions I have created have been solved (yay for splitting this
I am reposting this question due to inability to solve the problem (original here
My question is related with the previous solved question in How to save data
THis is a followup to my previous question Font-dependent control positioning. It's an attempt
I will start by saying that this is a 2-part question. I have a

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.