I am new to the Yii platform, and I am wondering how to change the dateformat. It’s currently in the American date format that is YYYY-MM-DD. I want it to be DD-MM-YYYY. Is there any way to this? Answer config file add in ‘components’ => [] You can add it and edit it to your style.
Tag: database
Left join on two tables and want to get results from a specific date
I have written a MySQL query to do left join on two tables . My result query is showing the result I wanted . I just want to know how to further make it limited to specific dates . The column which I want to sort is user_registered and is showing date in this format 2020-12-17 06:06:05. So how to
How to use a for loop to insert multiple records in a database table
I have simplified my problem into the following code: I am trying to get 10 records in the table, with each incrementing by one in the ‘x’ field. However, all I see is: Please advise. Thank you. Answer Here is how you can do that.
Is there a possibility to store device unique ‘identifier’ in my database? (PHP)
I am doing a poll voting system and I want each device to have only one chance to vote. How can I do that using PHP? Answer this will get value from the environment variable use of cookies //if user vote first time and successfully then set $vote = “success” then set cookie variable for that device for example //
I am getting Warning:count():Parameter error
I am getting this error below in my vehicles-update.php and I have also attached my vehicle/index.PHP code. It appears before my header on my phpmotors/index.php page. Warning: count(): Parameter must be an array or an object that implements Countable in C:xammp_124htdocsphpmotorsvehiclesindex.php on line 142 Error shown: if(count($invInfo)<1){ Answer Take a look at your function getInvItemInfo. What does that function return
How can I use an SQL query’s result for the WHERE clause of another query?
Okay, basically I have a table that contains statements like: I would like to use the contents from this table to generate other tables that fulfill the conditions expressed in this one. So I would need to make it something like But the last part of the where has to come from the first table. Right now what I’m trying
What is the right approach to insert multiple id’s of petitions to single user?
I am very open to edits of the title Basically I am making a site about petitions. I want a user to be able to sign more than one petitions and be able to see list of petitions he signed. I am wondering what is the right approach to do it. Approach 1 that I thought of: Every petition has
Laravel problem with data array from database
I cant figure out how assign variables in controller from array with database datas. this line: dd($user) return this : how can assign variables from array ? Answer You can use extract to extract array keys as PHP variables. Demo: https://3v4l.org/1IRRF
how can i upload image using react native expo image to my local server PHP / Database MySQL
I’m making a mobile application using expo client to allow user to upload image or take from a camera and then the image saves on my local server on PHP / Database MySQL. How do I do that thing if I’m …
Copy rows in MySQL table multiple times and adding additional column
I have created MySQL table in database. Table name is products and the columns are( prodict_id(pk) product_name and pack_size) as shown in the figure below. What I want to do is , copy all the rows …