How web database architecture works
Querying a database from web from
1 check and filter data coming from the user
2 set up a connection to db
3
4
5
Querying a database from php
1. Create connection
2. Select a database to use
3. Send query to the database
4. Retrieve the the result of the query
5. Close the connection
MYSQLI
1 creating connection
Procedural way
$conn= mysqli_connect (“severName”,”username”,”Password” );
Object oriented way
$conn=new
mysqli_connect (“severName”,”username”,”Password” );
2 select database
4th paramerter on connection or
use mysqli_select_db (conn,db);
3 Query database
Mysqli_query(conn,query);
4 close
$conn-> close;