<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s\n", maxdb_connect_error());
exit();
}
$query = "SELECT * from hotel.customer WHERE cno = 3000";
if ($result = maxdb_query($link, $query)) {
$row = maxdb_fetch_row($result);
/* display column lengths */
foreach (maxdb_fetch_lengths($result) as $i => $val) {
printf("Field %2d has Length %2d\n", $i+1, $val);
}
maxdb_free_result($result);
}
/* close connection */
maxdb_close($link);
?>