0

Do you need a prepared statement for simple view like displaying list of data? I'm trying to make a simple view that when user click the view button it will display the list of the information. User don't have to insert any information. So I was wondering do you need to make a prepared statement for this kind of view?

<?php
require_once "db.php";
require_once "session.php";

 $sql = "SELECT `no_usr`, `men_id`, `type`, `title`, `bass_name`,`men_status`
 FROM `men_info`";
 $query = mysqli_query($link,$sql);

?>
 

If I need to make a prepared statement how do reconstrat the query above into a prepared statement?

Dharman
  • 30,962
  • 25
  • 85
  • 135
waima
  • 23
  • 7
  • Does this answer your question? https://stackoverflow.com/questions/24988867/when-should-i-use-prepared-statements – Mech Oct 18 '20 at 04:51
  • ok thank you but the link is when I need to insert input. But this question is if i want to display the table without receiving any input. Do I still need to use the prepared statement? Like you can see in my query above i don't receive any input in query. i just want to display the all the info inside the table without specifying the `id`. – waima Oct 18 '20 at 05:34
  • Be sure to read the accepted answer in full, along with the comments: https://stackoverflow.com/a/24989031/4101210 – Mech Oct 18 '20 at 05:36

0 Answers0