Hello
I have a table with n columns
I want to fetch data from last column only.
How can I do that without have to define the column name or column max number.
As example
Quote:
<?php
session_start();
$database = '123';
$user = ($_SESSION['id']);
$password = ($_SESSION['password']);
$hostname = '456';
$port = 50000;
$conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database;" .
"HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP;UID= $user;PWD=$password;";
$conn = db2_connect($conn_string, '', '');
if ($conn) {
$sql = 'SELECT * FROM xxx ';
$stmt = db2_exec($conn, $sql, array('cursor' => DB2_SCROLLABLE));
if (!$stmt) {
echo 'SQLSTATE value: ' . db2_stmt_error();
echo 'with Message: ' . db2_stmt_errormsg();
}
while ($row = db2_fetch_array($stmt)) {
echo "\t<tr><td>$row[3]</td><td>$row[2]</td><td>$row[1]</tr>\n";
}
db2_close($conn);
}
else {
echo "Connection failed.";
}
?>
|
I want to echo "\t<tr><td>$row[n]</td></tr>\n";
Is that posible?
Thank You