PHP MySQL Select statement .

Veröffentlicht am: 15 März 2017
auf dem Kanal: Student Projects Live
153
1

Welcome to PHP programming,

The SELECT statement is used to select data from a database.

For selecting data from the database we are using an already existing table student from college database.

Select Data From a Database Table:

The SELECT statement is used to select data from a database.

Syntax:
SELECT column_name(s) FROM table_name;

The above syntax displays the records of the mentioned column name only.

To display the records of all the columns of the table we use the below syntax:

SELECT * FROM table_name;

The WHERE clause

The WHERE clause is used to filter records. It is used to extract only those records that fulfill
a specified criterion.

Syntax:
SELECT column_name(s) FROM table_name WHERE column_name operator value;

ORDER BY keyword

The ORDER BY keyword is used to sort the data in a record set. It sort the records in ascending
order by default. To sort records in descending order, use the keyword DESC.

Syntax:
SELECT column_name(s) FROM table_name ORDER BY column_name(s) ASC/DESC;

To get PHP to execute the statement above we use the mysqli_query() function.
This function is used to send a query or a command to a MySQL connection.

Let us write a PHP code to display records of the table student using the WHERE clause the class BBM.

Save it in our server i.e., xampp/htdocs

Run the code using the url http://localhost/select.php

Let us write a PHP codde to display all records of the table student in descending order of student_id

Save it in our server i.e., xampp/htdocs

Run the code using the url http://localhost/select1.php

This is how select statement works with PHP script.

Thank You..................

For source code kindly refer www.studentprojects.live

Do you have Any queries? Contact us in Whatsapp :- +91-9972853368

#studentprojects #phpcode


Auf dieser Seite können Sie das Online-Video PHP MySQL Select statement . mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Student Projects Live 15 März 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 153 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!