Php Mysql-database Examples Selecting a Database PHP code to establish a connection with MySQL Close database connections Creating a Database in MySQL Delete data from database table Delete data from database by ID Table data insert Use form to add data to database Adding a Row to a Table List all database List all tables in a database Get MySQL server information Get MySQL host information Get MySQL client information Print all MySQL status value List Database, Table, and Field Sending SQL Queries to a MySQL Database using the mysql_query () function Listing All Rows and Fields in a Table Get data from database query Finding the Number of Rows Returned by a SELECT Statement with mysql_num_rows() Get affected rows for an update Update Employee table Update data record and get the affected rows Calculating password length with DBM Storing structured data in a DBM database Tracking users and passwords with a DBM database Connect To MySQL Database Listing the Databases Available in a Connection Connect to MySQL Opening a Connection and Selecting a Database Print MySQL processes information Multiple Queries Using MySQLi Parameter Binding in MySQLi Use mysqli to fetch data from mysql Using the mysqli Object-Oriented API Using the Object-Oriented Syntax in MySQLi mysqli_fetch_object.php mysqli_fetch_result-2.php mysqli_fetch_result.php mysqli_fetch_row.php mysqli_free_result.php mysqli_multi_query.php mysqli_stmt_prepare.php mysqli_store_result.php retrieving_multiple_rows.php Using Transactions in MySQLi In PHP 5 using the MySQLi extension Discovering Which Extension Is Being Used MySQL Connection Test function mysql_connect() establishes an initial connection with the MySQL server. custom-error-messages.php Using mysqli_error() and mysqli_errno() Using the mysqli_fetch_array() Function function mysql_fetch_array() accomplishes the same result as mysql_fetch_row(), by default it assigns a returned row to an associative array. mysql_affected_rows() returns the number of rows affected by an SQL query involving an INSERT, UPDATE, REPLACE, or DELETE. Disconnecting from a MySQL Database function mysql_close() closes the connection. A function to open a connection to mysql Connecting to a MySQL Database Connecting user Creating databases When connecting to multiple MySQL servers, a link ID must be generated. Insert data to mysql table mysql_db_query.php Deleting databases An Example of Using the Old MySQL Extension while loop and mysql_fetch_array() function Get data from database mysql_fetch_array-2.php mysql_fetch_array.php Using timestamp with mysql Retrieving and Displaying Results Reading in Data mysql_fetch_field.php mysql_fetch_row() fetches rows mysql_fetch_row.php mysql_field_name.php mysql_field_table.php mysql_field_type.php mysql_list_processes.php Listing Tables mysql_list_tables.php mysql_list_fields.php mysql_num_fields.php int mysql_num_rows ( resource result ) mysql_num_rows.php function mysql_num_rows() determines the number of rows returned from a SELECT query statement. Add record to my_database/my_table Deleting Data Get data from mysql mysql_query.php function mysql_query() queries the database. Storing Information in a Database Using PHP variables wherever you want inside SQL queries Sign the guestbook Building Queries on the Fly mysql_result-2.php mysql_result.php function mysql_result() produces a data set. Create guestbook table Using MySQL with PHP mysql_select_db()mysql_select_db.php mysql_stat.php Listing databases mysql_tablename.php Unbuffered Queries for Large Data Sets odbc_close()odbc_connect()Using PHP's ODBC functions to interface with MS Access function odbc_exec() accomplishes the roles of both odbc_prepare() and odbc_execute(). Execute query with odbc_execute(). odbc_free_result()odbc_prepare()odbc_result_all() formats and displays all rows produced by odbc_exec() or odbc_execute(). Get column alias From result row get the table name Use mysql_result function to get query result Store query result in an array Use for loop to read all query result use Column name in select statement as the variable name Store query result in an Object Store query result in an associate array Get returned row count sql_regcase sqlite_array_query.php sqlite_column.php sqlite_create_function.php Using sqlite_current() and sqlite_next() sqlite_fetch_array.php sqlite_fetch_array-2.php sqlite_fetch_column_types.php sqlite_fetch_single.php sqlite_field_name.php sqlite_has_more.php Access sqlite database Copying Resultsets into an Array Manually Creating an SQLite database SQLite Error Constants sqlite_num_fields.php sqlite_num_rows.php Opening a SQLite Database Advanced Functions Using the sqlite_query() Function sqlite_query.php Using the sqlite_seek() Function sqlite_seek.php sql_regcase() function converts each character into a bracketed expression containing two characters. Reference columns by name Reference table columns by index Table-Creation Script Creating a Table in MySQL Create new table in MySQL Create table and install data Get all tables in a database Listing Tables in a Database Get table column flag Get column data type Get column name, type and max length Get field length Total number of fields in a table

Php Code : Unbuffered Queries For Large Data Sets

Unbuffered Queries for Large Data Sets in php

 
<?php 
            mysql_connect("localhost", "php", "password");
            mysql_select_db("phpdb");
            $result = mysql_unbuffered_query("SELECT ID, Name FROM conferences;");

            while ($row = mysql_fetch_assoc($result)) {
                    extract($row, EXTR_PREFIX_ALL, "conf");
                    print "$conf_Name\n";
            }
    ?>