I have the following mysql table “auctions”. The “quantity available”, “price” and the “current timestamp” will be updated every hour from an extern API. I want to store these datas for a price/ quantity archive. For that I need to archivate the older datas (qua…
Tag: mysql
convert some value from mysql query using php
using php I make a query to mysql. Inside my query, some values are in seconds (just some of them), I’d like to convert them into mm:ss. So I need to move into my “array” query and I do not understand how to move inside my query result, attribute after attribute. Here is my db : In my php co…
Laravel Query Sending Different Result For Same Problem
Hi I am trying to create a one on one messaging system on LARAVEL. It was working all fine until for some users it started showing different result then expected. And it happens only for some users.. What is wrong with this query After I return $messages the result is like this… Working Result: Messages…
Build a multidimensional PHP array out of MySQL table data linked by values in one column
I am using a WordPress plugin (Advanced CF7 DB). It puts the results of the contact form into the MySQL database so it can be displayed on the front end of the website. There are two tables with data like this. Table 1: Table 2: The id in table 1 corresponds to the data_id in table 2. I need to
Getting most popular tags [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question Writing a query that returns like the table below. What I am trying to do i…
Group by sum from two different table with the same id
I have created a simple butchery web application which has two tables: sells and bought. The bought table will include the kilos and price of each meat the user bought ,and the sells table will also …
Trying to take hidden input value with hidden mySQL ID
When I choose an option in my dropdown, I want to take it’s MySQL table ID and put it in a hidden input box. The MySQL table rows are correct, but the input box never changes. I’m using this to try to …
get users that did not buy a product
I have three tables users table products table users_buy table I want to get users who did not buy a specific product for example, user number 20 bought 5 product with ids [1,2,3,4,5] and user number 19 bought 3 product with ids [1,2,3] And user number 18 bought 2 product with ids [1,3] I want to get users wh…
Taking Array Post Data and INSERTING to sql
I am trying to get an Array of $_POST data and inserting it into mysql with 3 insert statements .. to make 3 new rows in a table. Form: The Variable in the name field is the Workshop ID number. The final mysql statement will be something like the following where $workshopid would come from the numbers inside …
How can I convert this mysqli to PDO?
prepare(“SELECT * FROM userinfo order by id DESC”); $query->execute(); mysqli_stmt_bind_result($…