简体   繁体   中英

Having trouble with PHP bind_param() with an UPDATE

Hi i am new to php and i am having trouble with bind_param. i have been trying for hours with no luck.

here is my code:

  $username="username";  
  $stmt = $mysqli->prepare("SELECT AdminID#, UserName, Password, Salt FROM AdminMembers WHERE  UserName = ? LIMIT 1");
  $stmt->bind_param('s', $username); // Bind "$username" to parameter.
  $stmt->execute(); // Execute the prepared query.
  $stmt->store_result();
  $stmt->bind_result($user_id, $username, $db_password, $salt);


  echo $user_id;
  echo "<br>";
  echo $username;
  echo "<br>";
  echo $db_password;
  echo "<br>";
  echo $salt;

i get a blank screen.

any one can see if i have something wrong with my code?

使用反引号

SELECT `AdminID#`, `UserName`, `Password`, `Salt` FROM AdminMembers WHERE  UserName = ? LIMIT 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM