Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
George Westrup: "I have saved so much time using your products. Also you are quick to respond to every question I have had. Thanks for the great support".
Dave Lantz: "I have to say that I simple love this product and its ease of use. I know that I have only tapped into about 20% of what it can do. In my business I come into a lot of contact with developers and I tell them all, that if they need an easy way to connect, report or work their databases they MUST check out your products".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

ExecQueryToArray

Еxecute a query that returns a result set.

 

Signature:

function ExecQueryToArray($sql, &$array)

 

Example:

$queryResult = array();

$sql = "SELECT first_name, last_name, email FROM customer WHERE active = 1";

$this->GetConnection()->ExecQueryToArray($sql, $queryResult);

 

foreach ($queryResult as $row) {

  $customerFirstName = $row['first_name']; // you can get the first name by key

  $customerFirstName = $row[0]; // or by index

   

  $customerLastName = $row['last_name']; // you can get the last name by key 

  $customerLastName = $row[1]; // or by index

  

  $customerEmail = $row['email']; // you can get the email by key 

  $customerEmail = $row[2]; // or by index

 



Prev Return to chapter overview Next