i have the follow code in PHP and HTML: And the JavaScript used in the button: In the beginning I am receiving the option of “Service 1” through a checkbox to proceed with the script I showed above, the problem arises when I want to select an ID from the 3 that are shown to generate a report in FPDF,
Tag: sql
Postgres, get all items from one table which ids are not in another tables JSON array column?
I have two tables: cars table which contains: electric_cars How to select all records from the cars table which are not in the non_valid_cars array of ids in the electric_cars column with id cars_id? Also, I am using Laravel Framework, but I will translate a query into the framework. Thank you so much for your help. Answer You can use
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
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
Multiple Tables Search, with Limit Clause and Known Result Source Table Names
A situation arose where I have to heuristically find out a table name from a common id. The tables have the same exact structure so I thought union or union all will work as suggested by some answers here. The problem is, applying a limit clause to the query is not working well. If I apply it on more than
Creating an auto incremented id when user submits a form
Currently I have a refno. column in my database with the format LP00001. Now I have a add page that inserts all data that the user inserts in the input field and all this data gets sent to a table in my database, but my refno column stays null which I want to have an auto incrementing value where the
PHP How to orderby two columns when the data is equal
This return come from this query. Let`s understand my doubt, i have this data. When i have the equal points data 0 is 120 and data 1 is 120. I need to display the first data with less totalTime in this case needs to be like this : Can i manage this only with SQL or i need to order
Prepared Statement does not use expected index
I have a very large table of IOT sample that I’m trying to run a relativly simple query against. Running the query normally using the MySql CLI returns a result in ~0.07 seconds. If I first prepare the query either via PDO or by running a SQL PREPARE statement then the request takes over a minute. I’ve enabled the the
How to update a column by joining four tables in laravel
I have four tables default_products_product_mileage_gap default_products_mileage_gap default_products_products default_products_products_mileage_gaps I am trying to update a column number_of_products_sold to some value using laravel What I have tried is: Here number_of_products_sold is not updating. How to update the column Answer Why you want to add four table together. here is an example to add or update multiple table from by controller.
I wanna create a new table from the data of two tables
I have a A table to store the product name, the quantity and input day of goods in stock. In adverse conditions, invoices for the above products will be sent later. I will put the product name and invoice quantity in B table. The problem here is that I want to check the quantity of goods with invoice and without