Skip to content
Advertisement

Tag: mysqli

Can some SQL queries be executed while the others fail?

I have read from some posts that it is a better practice to execute queries one by one instead of doing the multi-query function in PHP files. I wonder say I have two mysqli_query functions, is it possible that the first query succeeds and MySQL Database has been changed accordingly when the next query fails? If this is the case,

Fetch array data from one table and insert into another table

I want to fetch array data from “orders” Table WHERE order_id =2 and insert into “inventory_log” Table. but my code is only inserting the last row orders TABLE I want this: inventory_log TABLE Find my code below: Answer It is only inserting one row because you are only posting 1 product_id and 1 quantity your posted data in php now

mysqli query inside foreach loop- syntax problem

I have the following mysqli query: This is my database table “items”: $response is an API array from where I get the value for the item_ids . I get the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line

User updated information not showing

i have problem in my php which is user updated data is not showing in the page, it shows only the previous data and not the updated data, but the information already updated in database This is my updateForm.php: This is my stdUpdateData.php, where the sql database process the update data: This is the studentProfile.php,when user register for the first

Isn’t needed calling the mysqli function to insert values?

I am learning MySQL and PHP, I have seen that with this code you can insert values in the database: So like you see, this should work, but I don’t get how. If you are never calling the function mysqli_query, it is just stored in the $insert variable. It’s called in the if condition? Another thing that called my attention

Advertisement