Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase image then update = error, update then image = success! why?
    primarykey
    data
    text
    <p>So i am running into a perplexing (programmer caused) bug, me being the programmer.</p> <p>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.</p> <p>...<br> //I am uploading an image to the database.<br> imageConverter->loadImage($_FILE... blah balh).<br> ...<br><br> 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 :))<br></p> <p>The confusing part is this. When i EDIT the profile information, the order goes like this. i use MYSQLI ($this->mysqli->query($query)).</p> <p>these are edited in the database IF THEY ARE CHANGED</p> <ul> <li>1 firstname</li> <li>2 lastname</li> <li>3 password</li> <li>4 various preferences (check boxes / radio buttons).</li> <li>5 email</li> <li>6 profile picture.</li> <li>7 update session information with a query to the database for the most update information.</li> </ul> <p>Now #7 returns a false (SELECT * FROM USERSINFO)</p> <p>Now if i switch the order of action.</p> <ul> <li>1 firstname</li> <li>2 lastname</li> <li>3 password</li> <li>4 various preferences (check boxes / radio buttons).</li> <li>5 email</li> <li>6 update session information with a query to the database for the most update information.</li> <li>7 profile picture.</li> </ul> <p>It works just FINE.</p> <p>any answers? Does this mean that if 1000 people were trying to use my database at once that all there stuff would break?</p> <p>Some code:</p> <p>Inserting image (step #6 in not working example, #7 in working example)<br> $this->mysqli->query("DELETE FROM ".DB_REVIEW_IMAGE_TABLE." WHERE email='$email'");<br> if ($this->mysqli->query("INSERT INTO ".DB_REVIEW_IMAGE_TABLE." VALUES('$email', '$content', '$imageType')"))<br><br></p> <p>Updating user information into session information. (step #7 in bad example, #6 in working example)<br> $this->userInfo = $_SESSION[SESSION_USER_INFO] = $database->getUserInfo($this->email);<br><br> 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<BR><BR> I like to use constants :). And DB_USERS_SEX = male or female (just in case)<br><br> Michael</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload