Posts

Showing posts from September, 2018

angular basic commands

The version of npm is 3.10.10. Now that we have nodejs and npm installed, let us run the angular cli commands to install Angular 4. You will see the following commands on the webpage − npm install -g @angular/cli //command to install angular 4 ng new Angular 4-app // name of the project cd my-dream-app ng serve Let us start with the first command in the command line and see how it works. To start with, we will create an empty directory wherein, we will run the Angular CLI command. We have now installed Angular 4. Let us now create our first project in Angular 4. To create a project in Angular 4, we will use the following command − ng new projectname We will name the project  ng new Angular 4-app . Now that we have the file structure for our project, let us compile our project with the following command − ng serve The  ng serve  command builds the application and starts the web server. The web server starts on port 4200. Type the url  http://l...

Getting distinct rows from table with count

<?php $result =  $this->db->query("SELECT ticket_code,COUNT(*) as count FROM total_tickets_private GROUP BY ticket_code ORDER BY count DESC;")->result();   <td><?=$res->ticket_code ?></td>     <td><?=$res->count ?></td> ?>