Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql fetch all data

//Database Connection
$sqlConn =  new mysqli($hostname, $username, $password, $database);

//Build SQL String
$sqlString = "SELECT * FROM my_table";

//Execute the query and put data into a result
$result = $sqlConn->query($sqlString);

//Copy result into a associative array
$resultArray = $result->fetch_all(MYSQLI_ASSOC);

//Copy result into a numeric array
$resultArray = $result->fetch_all(MYSQLI_NUM);

//Copy result into both a associative and numeric array
$resultArray = $result->fetch_all(MYSQLI_BOTH);
Comment

PREVIOUS NEXT
Code Example
Sql :: sql create table 
Sql :: sql script to remove default from column 
Sql :: split string by comma in sql server 
Sql :: difference between normalization and denormalization 
Sql :: influxdb delete measurement based on date 
Sql :: sql statement to change a field value 
Sql :: mysql update command 
Sql :: symfony Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails 
Sql :: mysql concat and use as where column 
Sql :: bigquery timestamp 
Sql :: remove root password mysql 
Sql :: sql date function 
Sql :: relation does not exist postgresql 
Sql :: Sequelize model datatype of enum 
Sql :: export mysql table to file 
Sql :: oracle db timestamp auto add 
Sql :: add column postgresql 
Sql :: mysql search replace 
Sql :: sql select 
Sql :: mssql remove duplicate rows 
Sql :: primary key sql 
Sql :: coalesce function in sql server 
Sql :: select count distinct multiple columns sql server 
Sql :: mysql date time string format for marshmellow field schema 
Sql :: sql foreign key constraint 
Sql :: show database not empty tables postgres 
Sql :: mysql range of dates overlap 
Sql :: mssql now diff 90 day 
Sql :: oracle create or replace index 
Sql :: make selected text uppercase mssql 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =