Jump to content

Zserene

New Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Zserene

  • Rank
    Newbie
  1. The p_id pulls over data fine. It's only when I go to update that the error occurs. $the_user_id is set to the p_id at the top of the code. It is then used in the "WHERE" statement of the query to update the correct row in the database: But this code is a duplicate from another page I made, the only difference is on this page I use a bootstrap table, not sure that should make any difference though. I don't know The p_id brought over is for user "1" and is set to $the_user_id via: if(isset($_GET['p_id'])) { $the_user_id = $_GET['p_id']; }
  2. <?php //THE "p_id" IS BROUGHT OVER FROM THE EDIT BUTTON ON VIEW_ALL_USERS if (isset($_GET['p_id'])) { $the_user_id = $_GET['p_id']; } // QUERY TO PULL THE SITE INFORMATION FROM THE p_id THAT WAS PULLED OVER $query = "SELECT * FROM users WHERE user_id = $the_user_id "; ---------------------------------row 10 $select_user = mysqli_query($connection,$query); //SET VALUES FROM ARRAY TO VARIABLES while($row = mysqli_fetch_assoc($select_user)) { -------------------------------------------------row 14 $user_id = $row['user_id']; $u
  3. This is the button on the users page that sets p_id and sends to edit_user: and then at the top of the "edit_user" page it looks like p_id is pulled over: The first for statement at the top of the edit_user page is the if(isset($_GET['p_id'])) { $the_user_id = $_GET['p_id']; Also the page that catches it displays all the user data fine, its only when i got to update it to the DB that it breaks with error.
  4. I have a table with a list of users and an edit button and delete button. When the edit button is pressed on a site it passes the user_id as p_id to the page that catches it and displays the data. The problem is when I click on the "update user" button, I get the following error: Warning: Undefined variable $the_user_id in C:\xampp\htdocs\3-19-21(2) - SafetySite\admin\edit_user.php on line 10 Fatal error: Uncaught TypeError: mysqli_fetch_assoc(): Argument #1 ($result) must be of type mysqli_result, bool given in C:\xampp\htdocs\3-19-21(2) - SafetySite\admin\edit_user.php:14 Sta
  5. Barand, Thanks so much! That is amazingly helpful and work great. I'll start using this format on the rest of the tables with multi line responses. And thanks for the pointers on placement (or lack thereof) of code within the while loop, easier to fix this stuff now than when I get everything finished up.
  6. Hi, My company has 240+ locations and as such some users (general managers) cover multiple sites. When I run a query to pull user information, when the user has multiple sites to his or her name, its adds the second / third sites to the next columns, rather than wrapping it inside the same table cell. It also works the opposite way, if a piece of data is missing in the database and is blank, its pull the following columns in. Both cases mess up the table and formatting. I'm extremely new to any kind of programming and maybe this isn't the forum for this question but figured I'd give i
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.