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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:05:59+00:00 2026-05-17T23:05:59+00:00

So i am running into a perplexing (programmer caused) bug, me being the programmer.

  • 0

So i am running into a perplexing (programmer caused) bug, me being the programmer.

I have created a website with user profile. The user profile has many fields and an image. The image is uploaded just fine. First it is converted to fit into a certain area.

…
//I am uploading an image to the database.
imageConverter->loadImage($_FILE… blah balh).
…

When the user decides to change his information, he also has the chance to change his picture. The edit profile process IS THE EXACT SAME AS PROFILE STARTING process. The only difference is i check the fields he/she updated one at a time, and change that specific line int the database (obviously this can be done optimally, but first i want it to work :))

The confusing part is this. When i EDIT the profile information, the order goes like this.
i use MYSQLI ($this->mysqli->query($query)).

these are edited in the database IF THEY ARE CHANGED

  • 1 firstname
  • 2 lastname
  • 3 password
  • 4 various preferences (check boxes / radio buttons).
  • 5 email
  • 6 profile picture.
  • 7 update session information with a query to the database for the most update information.

Now #7 returns a false (SELECT * FROM USERSINFO)

Now if i switch the order of action.

  • 1 firstname
  • 2 lastname
  • 3 password
  • 4 various preferences (check boxes / radio buttons).
  • 5 email
  • 6 update session information with a query to the database for the most update information.
  • 7 profile picture.

It works just FINE.

any answers? Does this mean that if 1000 people were trying to use my database at once that all there stuff would break?

Some code:

Inserting image (step #6 in not working example, #7 in working example)
$this->mysqli->query(“DELETE FROM “.DB_REVIEW_IMAGE_TABLE.” WHERE email=’$email'”);
if ($this->mysqli->query(“INSERT INTO “.DB_REVIEW_IMAGE_TABLE.” VALUES(‘$email’, ‘$content’, ‘$imageType’)”))

Updating user information into session information. (step #7 in bad example, #6 in working example)
$this->userInfo = $_SESSION[SESSION_USER_INFO] = $database->getUserInfo($this->email);

which $database->getUserInfo($this->email) == “SELECT “.DB_USERS_ALL_MOUNTAIN.”, “.DB_USERS_BACK_COUNTRY.”, “.DB_USERS_GROOMERS.”, “.DB_USERS_PARK.”, “.DB_USERS_SEASON_DAYS.”, “.DB_USERS_SEX.”, “.DB_USERS_YEARS.”, “.DB_USERS_FIRST_NAME.”, “.DB_USERS_LAST_NAME.”, “.DB_USERS_CITY.”, “.DB_USERS_STATE.” FROM “.DB_USER_INFO_TABLE.SQL_WHERE_EMAIL


I like to use constants :). And DB_USERS_SEX = male or female (just in case)

Michael

  • 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-17T23:05:59+00:00Added an answer on May 17, 2026 at 11:05 pm

    Ok the answer was simple.

    My database class had a modular level var called $mysqli. This $mysqli was somehow getting used at the same time.

    I my made 2 sequential calls.

    • updatePic
    • updateSessionInfo

    Each used the database. But by having the modular level var $mysqli would somehow cause a conflict. Especially because session info and picture information are in two different databases. I must not know much about php, but these have to execute before the other one is finished. THEREFORE, to break this up, each method within the database

    • creates a connection to the database
    • sets the database to use.
    • executes the query
    • closes the connection / result sets.

    Now it works!

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

Sidebar

Related Questions

No related questions found

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.