Skip to content

Tag: mysql

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?…

Update price column in database laravel

I am trying to pass along updated pricing to my orders table but am getting an error: In my controller I have this: The error is coming from the $newPaymentTotal that I want use to update the price that was in there before. That column is set up as a decimal as well. Answer Your line $request->session()-&g…

Maching users from username to user_group

So im setting up a ranks system on my website. (there is probably an easier way to do it) Here is what i tried. and here is my server.php file for extra info. (details included) Basically i want to set certain sessions to certain groups, its the only way i can hide links from users that are either logged in/l…

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 …