I have a table containing a datetime column: and I add a row (storing the datetime of the addition of the row in UTC) with This works. Now when displaying the rows: the date is displayed like this, in UTC: 2019-04-27 16:41:33. How to display it in the local timezone instead? (including Daylight Saving) I can imagine there are different
Tag: php
Searching database using `LIKE` and `MATCH AGAINST` in MySQL
I have a table in my database called pro_search where I have translated the meta information for different products in different languages. My table structure is like so:id pro_id en de es fr …
How to use LIKE in oracle with PHP
I am trying to use a simple SQL statment with the LIKE operator. This SQL statement works on SQL developer but not when I try it on PHP. SELECT * FROM hotels WHERE lower(name) LIKE ‘%luxury%’; …
How to get list of movies based on genre and language
I have stuck to get list of movies based on genre and language. Here’s my database structure: movies table ———————– id | title| ———————- 1 | ABC 2 | PQR 3 | MNC …
Is there any other way to extract the number of exam?
Hello everyone I have a problem that I need help with I’m trying to get number of exam for specified student we have three tables : etudient (N_Appoge,Nom,PRENOM,filiere,….) module (NUM_Module,…
Fetch data of two tables with/without match of Primary key and foreign key
I am using this query. select * from customers E JOIN `customer_p` D ON (E.ID = D.`P_ID`) Here E.ID is primary key of customers table and p_ID is foreign key of customer_p This query fetches only …
Storing multi rows from php to sql
When i send post from php to save input values in seperate rows i’m ending with that in ma table always is stored extra blank rows. For example this is the form from which i send post to save values: …
Running an insert script from multiple values
I’m trying to run a pretty simple script that does the following: Takes the id of a content module and assigns it to multiple locations So say I click the link on a content module with ID of 123, I …
Fetching constraints in SQL database to JSON in PHP
Let’s assume I have the following database structure of car manufacturers and the corresponding cars: manufacturers: cars: The id column of manufacturers is the primary key and the manufacturer column of cars has the corresponding foreign key constraint. I’d like to produce the following JSON output using PHPs json_encode: To get the manufacturers and their founded_in I’d just perform: And
Duplication of results after selecting data from two tables with the same values
Good day! I’m having a problem in duplication of results when I’m selecting data from two tables with the same values. I have one data in my first table homepost with an ID of 2 and I have three data …