PHP MySQL Select statement .

Publicado em: 15 Março 2017
no 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


Nesta página do site você pode assistir ao vídeo on-line PHP MySQL Select statement . duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Student Projects Live 15 Março 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 153 vezes e gostou 1 espectadores. Boa visualização!