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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:11:12+00:00 2026-06-06T01:11:12+00:00

Im trying to enter certain values to a db table and although its going

  • 0

Im trying to enter certain values to a db table and although its going through, not all
the values are being populated.

im going to skip some parts because again, its not that im not connecting etc, the problem is that although i am getting through and communicating with the db, on info upload, only certain fields are being populated.

so for example,

My “username / password ” fields have the same values within the db so im not sure
why one field is being populated and the other is not…

but here is some code..theres alot of it so im gonna copy/paste the important parts

the html for example is

<input type="text" name="uname" id="uname" value="Enter Desired Username"/><br/>
<input type="text" name="upass" id="upass" value="Enter Desired Password"/><br/>

etc...you know same old html

the php
the connection works etc..

the variables

$c2d = "the db connection here";
$userName = mysql_real_escape_string($_POST['uname']);
$userPass = mysql_real_escape_string($_POST['upass']);

//here i set up all my vars but this is the problematic one.

$addDetails2DbQueryS = "INSERT INTO accounts (appUname, appUpass)VALUES('$userName','$userPass')";

$addDetails2DbQueryS = "INSERT INTO accounts (appUname, appUpass) VALUES('$userName','$userPass')";

//perform some checks here like if the account thats being created already exist etc..
and this works as well too blah blah

then when all is good, add the account to the db
to which im using this

$addDetails2DbQuerySDoIt = mysqli_query($c2d, $addDetails2DbQueryS) or die("error [003] could not add acc to db" . mysqli_error);

And whats happening is, The username is logged but the password field is empty

Any ideas what im doing wrong? thanks in advance and
ANY help i gladly and humbly appreciate. Thank you

  • 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-06T01:11:13+00:00Added an answer on June 6, 2026 at 1:11 am

    Youre using the wrong escaping function… youre using mysql_real_escape_string from the ext/mysql extension, but youre actually using the MySQLi extension to do youre insert, so you should be using its version of the function mysqli_real_escape_string.

    Use one DB driver or the other, not both 🙂

    I would actually expect you to get false for both values because if you havent established a db connection with mysql_connect the calling mysql_real_escape_string should return false and generate a waring:

    The MySQL connection. If the link identifier is not specified, the
    last link opened by mysql_connect() is assumed. If no such link is
    found, it will try to create one as if mysql_connect() was called with
    no arguments. If no connection is found or established, an E_WARNING
    level error is generated.

    If you have estabished a mysql_connect() connection then i would expect your mysqli_query() to fail because you never established a connection with mysqli_connect().

    I think once you pick one of the 3 DB drivers and only use the classes/functions of ONE of those most of your issues are going to disapear:

    1. PDO (my favorite, elegant, pretty easy to use, easier to port code to a diff. db if needed)
    2. MySQLi (offers the best range of MySQL specific features, but is clunkier to use)
    3. ext/mysql (avoid like the plague when possible)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Its been a while now and im still trying to get a certain code
I am trying to enter values into a mysql db using python. To this
I'm trying to enter a date in a mysql table `ssdate` datetime The function
I am trying to allow users to enter Hebrew characters into certain fields in
I am trying to do some additional checks and formatting on certain fields of
I'm trying to enter edit mode on a specific cell like this: void MainWindow::on_addButton_released()
I'm trying to enter a value in a specific records , I have a
I'm trying to capture the ENTER event of a TextInput like so: a_txt.addEventListener(fl.events.ComponentEvent.ENTER, aEnter);
I'm trying to require the user to enter data in at least one of
I'm trying to make a field where user will enter amount of time per

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.