ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:deprecated

This is an old revision of the document!


Deprecated Functionality

MySQL and Menus

Connect to MySQL database agora, and generate a <select> menu from an SQL statement where the <option> captions are in the 1st column, and the value to send back to the server is in the 2nd column.

include('adodb.inc.php'); # load code common to ADOdb

$conn = &ADONewConnection('mysql');  # create a connection

$conn->PConnect('localhost','userid','','agora');# connect to MySQL, agora db

$sql = 'select CustomerName, CustomerID from customers';
 
$rs = $conn->Execute($sql);
 
print $rs->GetMenu('GetCust','Mary Rosli');

Here we define a menu named GetCust, with the menu option 'Mary Rosli' selected. See GetMenu(). We also have functions that return the recordset as an array: GetArray(), and as an associative array with the key being the first column: GetAssoc().

v5/userguide/deprecated.1457912273.txt.gz · Last modified: 2017/04/21 11:39 (external edit)