PHP MySQL Select statement .

Publicado el: 15 marzo 2017
en el canal de: 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


En esta página del sitio puede ver el video en línea PHP MySQL Select statement . de Duración hora minuto segunda en buena calidad , que subió el usuario Student Projects Live 15 marzo 2017, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 153 veces y le gustó 1 a los espectadores. Disfruta viendo!