cubrid_fetch_array
Fetch a result row as an associative array, a numeric array, or both
&reftitle.description;
arraycubrid_fetch_array
resourceresult
inttypeCUBRID_BOTH
The cubrid_fetch_array function is used to get a
single row from the query result and returns an array. The cursor
automatically moves to the next row after getting the result.
&reftitle.parameters;
result
Result comes from a call to cubrid_execute
type
Array type of the fetched result CUBRID_NUM, CUBRID_ASSOC, CUBRID_BOTH.
&reftitle.returnvalues;
Returns an array of strings that corresponds to the fetched row, when process is successful.
&false;, when process is unsuccessful.
The type of returned array depends on how type is defined. By using CUBRID_BOTH (default), you'll get an array with both associative and number indices, and you can decide which data type to use by setting the type argument. The type variable can be set to one of the following values:
CUBRID_NUM : Numerical array (0-based)
CUBRID_ASSOC : Associative array
CUBRID_BOTH : Numerical & Associative array (default)
&reftitle.examples;
cubrid_fetch_array example
10000");
printf("%-40s %-10s %-6s %-20s\n", "name", "area", "seats", "address");
while ($row = cubrid_fetch_array($req, CUBRID_NUM)) {
printf("%-40s %-10s %-6s %-20s\n", $row[0], $row[1], $row[2], $row[3]);
}
cubrid_close_request($req);
cubrid_disconnect($conn);
?>
]]>
&example.outputs;
&reftitle.seealso;
cubrid_execute