I need to extensively use statuses in mt project. I need them for my users (active, suspended, etc), an entity (active, pending_activation, inactive) and for my subscriptions(active, on_grace_period, not_subscribed, never_subscribed). So far I thought that the best way is to store them in the DB but i have a …
Tag: mysql
How to use mysqli_query() in PHP?
I’m coding in PHP. I have the following mySQL table: I’m trying to use the mysqli_query function in PHP to DESCRIBE the table. Here’s my code: The documentation says For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result object. But from there I d…
Change background color of a cell when next value is different from the preceding one
I’ve been around for years on Stack but this is my first time posting. I’m working on a website (php + mysql) and the following problem is driving me absolutely nuts. I have a table with 2 columns: Size and Amount. The table is generated by a basic php script simply outputting values stored in the…
Search tags in mysql table with PHP
I have a table with some submissions, this table has a tags field, and I need to search in it. The data is saved in JSON format in the table, like this: [“basic”,”example”,”html”,”chart”] I’m trying …
Bidding System PHP-MYSQL
I am working on the bidding system app, stuck on how to select the appropriate data and display. See the table screenshot. What I trying to retrieve is for example for bid_id p1 I want latest fbid,name, total amount of all 3 records having bid_id=p1. Answer I believe this is the query you are looking for̷…
inserting array value to database laravel
I have a form attributes called, name, description and features where features is a multiple checkboxes which is like feature 1 feature 2 feature 2 feature 4 User can select multiple checkbox at …
Reloading .env variables without restarting server (Laravel 5, shared hosting)
My Laravel 5 has run OK until the database was configured, then found this error: Doing some research it seems that I configured MySQL access too late, so I should restart the server in order to get the correct environment variables. Well, I’m using Dreamhost’s shared server and I just can’t…
Insert into database from android using PHP
I’m trying to insert some data from my android application into my database using php, I tried below script but I get this error PHP script Android Part Answer You have got small error in your PHP script
Update mySQL rows after specified time (PHP, MySQL)
I have a table with users. I want the “status” value of this user to change after some period of time (In months (from 1 to 12)). For example: A new row is added with the Name = Jack, Age = 20, …
Is LEFT JOINING two tables with no reference to each other ON string conditions a bad idea?
I’m migrating database between 2 systems using PHP and MySQL. In the old one I have 3 tables of interest: t1 id (int) … t2 id (int) t1_id (int) d (string) … t3 id (int) t1_id (int) ds (string) e (int) … In the new one I have only t1 and t2 t2.d can have e.g. “abc” or “…