Skip to content
Advertisement

Tag: sql

Updating multiple tables in SQL using an Array

Currently I had a table called crm_leads for my Leads page where I already have many records. Now for the same page I have created few new fields which is now going to be stored in another table called crm_leads_details. Now I’m storing all my POST values in an array format like so: Now in my model I’m trying to

Get the final price with discount but only if column is not NULL. SQL

I use these sql tables with these columns: customers: id name phone adress etc.. 1234 Test Name Test Phone Test Adress etc data. orders: customerid orderid orderdate 1234 OR_1234 2022-1-1 orderitems: (in this table one customer can have multiple rows(items) id orderid productid 1 OR_1234 P1 products: productid productprice currency qty name weight P1 10 USD 1 TEST 0.2 KG

Updating stocks quantity in Product Table from Cart

Hello everyone so basically I have this 2 tables ProductLists and Cart Note: Cart table contains temporary datas inside it, if the orders inside cart table are already paid the table itself will truncate. I tried running this query and this happened output any advice on how to do this without making the stocks of the other products go Null?

Why do these two SQL queries return a different number of rows?

If I execute the following query in Workbench, I get back the expected number of rows — 5. However if I enter the same user_id in the search field of my web app it returns ALL orders, whether or not it has been refunded, but still lists the total number of refunds as 5. Any help is appreciated. Answer Because

Hiding a button dependant on cell value in table

I currently have a table that data is being reported into with a few buttons at the end to perform actions (Consign, Unconsign, Edit, Delete). I’m trying to hide the Consign and Unconsign buttons for each row in the table depending on the Yes/No value a column. So far, I’ve managed to get the button Consign to hide if the

How do I pass the values of my checkboxes with PHP to mySQL database?

Now the value in my database is just “Array”. Because, well it is an array. It can see whether I checked at least one thing, or no things at all. If I don’t check any checkboxes it returns nothing, if I check at least one thing it returns “Array”. I haven’t worked with PHP before, and we didn’t get any

Advertisement