HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
HTML Tutorial

CSS Tutorial

PHP mysqli_query() Function - mysqli query


The mysqli_query() function performs a query against the database.

PHP mysqli query result - example


Syntax: The basic syntax of the mysqli query;
mysqli_query(connection, query, resultmode);

Example 1:
<?php
$conn=mysqli_connect("localhost", "user", "password", "databbase");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL:". mysqli_connect_error();
  }
// Perform queries 
mysqli_query($conn,"SELECT * FROM users");
mysqli_query($conn,"INSERT INTO users (FirstName, LastName, email, password) 
VALUES ('Nicky','Lauda',' NickyL@yahoo.com', 'gyars225%ABER')");
mysqli_close($conn);
?>

Note: Be careful when you are deleting records in a table!

mysqli query, select database mysqli PHP mysqli_query() Function - mysqli query - sql tutorial

2578. SQL LIKE - SQL Tutorial

http://www.sql-tutorial.net/SQL-LIKE.asp

2562. Link to SQL Tutorial - SQL Tutorial

http://www.sql-tutorial.net/link-to-SQL-Tutorial.asp

3285. PHP mysqli_connect () Function, sql tutorial
PHP mysqli_connect () Function sql tutorial
https://www.agernic.com/sql-tutorial/php-mysqli-connect-function.html

2598. SQL tutorial will teach you how to use SQL - Database, sql tutorial
SQL tutorial will teach you how to use SQL - Database sql tutorial
http://www.agernic.com/sql-tutorial/sql-tutorials-sql-database.html

2569. SQL database table - SQL Tutorial

http://www.sql-tutorial.net/sql-database-table.asp

3291. SQL IN Operator - example, sql tutorial
SQL IN Operator - example sql tutorial
https://www.agernic.com/sql-tutorial/sql-in-operator-with-example.html

Your add here
How to get PHP errors to display?
How to prevent sql injection in php mysqli
How do I get PHP errors to display - PHP error_reporting()
mysql_query(): The mysql extension is deprecated and will be removed i
Function eregi_replace() is deprecated in php - How to fix
PHP delete an element from an array
Uncaught Error: Call to undefined function MYSQL_NUM_ROWS() in
Deprecated: mysql_connect() mysql extension is deprecated and will be
mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean g
SQL IN Operator - example
SQL BETWEEN Operator
SQL like syntax and example
SQL WHERE AND & OR multiple conditions
SQL create table primary key autoincrement
PHP mysqli_connect () Function
SQL COUNT(), AVG() and SUM() Functions
Display data from SQL database with MySQLi into php - html table
SQL CREATE DATABASE - example
SQL mysql order by columns, by date, by asc, by desc, random with PHP
PHP mysqli_query() Function - mysqli query
SQL delete row - SQL delete table
SQL update - SQL update select
Insert into SQL - Insert into table SQL - Insert data in sql
Login in PHP - simple login script with PHP MYSQL