![]() We need to create one view files name pie_chart.php and update the following code into your file: "' GROUP BY DAYNAME(created_at) ORDER BY (y_date) ASC") $query = $this->db->query("SELECT created_at as y_date, DAYNAME(created_at) as day_name, COUNT(id) as count FROM users WHERE date(created_at) > (DATE(NOW()) - INTERVAL 7 DAY) AND MONTH(created_at) = '". In this controller, we will create some method/function. Here, in this fourth step go to app/Controllers and create a controller name Chart.php. 'DBDebug' => (ENVIRONMENT != 'production'), After opening the file in a text editor, We need to set up database credentials in this file like below. we need to go app/Config/Database.php and open database.php file in text editor. In this section we require to connect our project to the database. ![]() ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='datatable demo table' AUTO_INCREMENT=1 Name varchar(100) NOT NULL COMMENT 'Name',Įmail varchar(255) NOT NULL COMMENT 'Email Address',Ĭontact_no varchar(50) NOT NULL COMMENT 'Contact No',Ĭreated_at varchar(20) NOT NULL COMMENT 'Created date', Id int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary Key', This is optional however, if you have not created the codeigniter app, then you may go ahead and execute the below command:Ĭomposer create-project codeigniter4/appstarter ci-newsĪfter successfully install the composer open your terminal fire this following command. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |