Skip to content

Latest commit

 

History

History
74 lines (65 loc) · 3.34 KB

n5aa.md

File metadata and controls

74 lines (65 loc) · 3.34 KB

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors Visitors

Don't forget to hit the ⭐ if you like this repo.

PHP: MySQL and CRUD

Set A

Here are the answers to the questions:

  1. a) MySQL
  2. a) mysqli_connect()
  3. b) mysqli_query()
  4. a) Structured Query Language
  5. c) mysqli_fetch_assoc()
  6. b) mysqli_num_rows()
  7. b) mysqli_escape_string()
  8. a) INSERT INTO
  9. b) mysqli_insert_id()
  10. d) All of the above
  11. b) mysqli_close()
  12. c) Both associative and numeric arrays
  13. d) mysqli_stmt_execute()
  14. b) mysqli_error()
  15. a) $mysqli->affected_rows
  16. c) pdo_transaction()
  17. a) $pdo->lastInsertId()
  18. a) UPDATE
  19. d) All of the above
  20. a) Retrieves all users with an age greater than 25
  21. a) $pdo->rowCount()
  22. a) Prints the number of rows in the "users" table
  23. b) mysqli_fetch_row()
  24. a) By specifying the column name in the fetch function
  25. b) mysqli_free_result()
  26. b) mysqli_num_fields($result)
  27. a) DELETE FROM
  28. a) By specifying the field name in the fetch function
  29. a) Prints the number of rows in the "users" table
  30. b) mysqli_error()
  31. b) mysqli_fetch_all()
  32. b) SELECT AUTO_INCREMENT FROM table
  33. b) mysqli_escape_string()
  34. a) $mysqli->affected_rows
  35. a) Prints the name of the user with ID 1
  36. a) $pdo->rowCount()
  37. c) $pdo->beginTransaction()
  38. a) $mysqli->insert_id
  39. a) Prints "User inserted successfully" if the query is successful
  40. a) $result->columnCount()
  41. c) $result->fetch()
  42. a) Prints the number of fields (columns) in the "users" table
  43. a) By specifying the column name in the fetch function
  44. c) $result->close()
  45. a) $result->rowCount()
  46. a) Prints the number of users with an age greater than 25
  47. a) $pdo->errorInfo()
  48. a) $result->fetchAll()
  49. b) SELECT AUTO_INCREMENT FROM table
  50. a) Prints "User deleted successfully" if the query is successful

Contribution 🛠️

Please create an Issue for any improvements, suggestions or errors in the content.

You can also contact me using Linkedin for any other queries or feedback.

Visitors