Do we need to test the return value of bind_param when building prepared statements in PHP? [closed]

Linked question is here. I have upgraded the code in the linked question to use a prepared statement. I now have: $stmt = $conn->prepare(“INSERT INTO `workbook-data` (`workbook-language`, `gui-…

populating my dropdown menu using procedural prepared statement

I would like to ask on how do I populate my dropdown/ via retrieving my data in MySQL database. I am using procedural prepared statement to add a security or avoid SQL injection. Problem:…

Use more placeholders in WHERE statement after IN statement with arrays

I need more placeholders to be added to the following query. Is this possible? I have no idea where to begin and I can not find any options on the Internet. The query now: $in2 = str_repeat(‘?,’, …

Check availability of appointment slot

I am creating an area for a user where he can make an appointment. The available appointments are inside a table called: bigo_appuntamento This table has these 5 fields bigo_appto_id –> ID …

Why I can’t connect to a MySQL 5.3.36 shared server using mysqli_connect and PHP 7.4, but it will work using php 7.1?

I have this shared account on Hostgator. Using PHP 7.1 and mysqli_connect, I have no issue connecting to the MySQL 5.3.36 database. The PHP script should be fine. The hosting company sent me an email …

What is the difference between mysqli::connect and new mysqli?

Mysqli library offers a number of alternative syntaxes for establishing connection to the MySQL server. #1 $mysqli = new mysqli(‘localhost’, ‘my_user’, ‘my_password’, ‘my_db’); # 2 $mysqli = new …

PHP mysqli and SSL

I am trying to configure Galera Cluster over a WAN (VPN is not an option). For obvious reasons I am setting up the connections to require SSL keys, and am having difficulties getting the application …

How can I convert this mysqli to PDO?

prepare(“SELECT * FROM userinfo order by id DESC”); $query->execute(); mysqli_stmt_bind_result($…

How to user fetch_assoc() twice in a single php file?

I have two table. One is an article list and the other one is a category list. In the category table, I have use fetch_assoc() to get the data from my DB and list in the table. But I want to fetch the …

How do i store / serialize php returned mysqli_query results?

I’m trying to store results returned from mysqli_query as cache, so if the same “SELECT” statement is executed, it will get from the cache instead of going through mysql server BUT the …