It performs a query in specified database, the format is as follows:
Object Oriented Style:
mixed mysqli::query ( string $query [, int $resultmode ] )
mixed mysqli_query ( mysqli $link , string $query [, int $resultmode ] )
There are three parameters are present in it, link, query and resultmode.
In the example below though it is similar to previous example, but to maintain the ease of understand we put the same example.
printf("Connection failed:%s \n",mysqli_connect_error()); exit();
$result=$db->query("select name from student");
printf("Affected rows:%d \n",$db->affected_rows);
Affected rows :- 1