Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- matrix_id, user_id, position_1, position_2, position_3
- 1 1 1982 2251 5841
- 2 2 6204
- 3 3
- 4 4
- $find_user = $db->prepare("SELECT * FROM matrix WHERE user_id > :user_id");
- $find_user->bindValue(':user_id', 0);
- $find_user->execute();
- $result_user = $find_user->fetchAll(PDO::FETCH_ASSOC);
- if(count($result_user) > 0) {
- foreach($result_user as $row) {
- $matrix_id = $row['matrix_id'];
- $user_id = $row['user_id'];
- $position_1 = $row['position_1'];
- $position_2 = $row['position_2'];
- $position_3 = $row['position_3'];
- }
- } else {
- $errors[] = 'User Id not found in Matrix.';
- }
- $update_user = $db->prepare("UPDATE matrix SET position_2 = :position_2 WHERE user_id = :user_id");
- $update_user->bindValue(':position_2', 1564;
- $update_user->bindParam(':user_id', $user_id);
- if($update_user->execute()) {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement