Page 1 of 1

retrieve record from Oracle by its position?

Posted: Wed May 14, 2003 10:32 am
by jiehuang001
I have been using JSP + Oracle. In JSP, to retrieve records, I can write some code like the following:
rs=stmt.executeQuery("select first_c, second_c, third_c from tablename");
while (rs.next()) {
String first_c = rs.getString(1);
String second_c = rs.getString(2);
String third_c = rs.getString(3);
}

In PHP, can I do something similar as above? That is, can I use number to retrieve a record in Oracle table?

Thanks.

Jie Huang

Posted: Wed May 14, 2003 11:02 am
by volka
almost.

Code: Select all

$result = mysql_query('blablabla', $dbConn);
$row = mysql_fetch_row($result);
echo $row[0];
echo $row[1];
echo $row[2];

// or 

$result = mysql_query('blablabla', $dbConn);
$row = mysql_fetch_array($result);
echo $row['first_c,'];
echo $row['second_c,'];
echo $row['third_c,'];

Posted: Thu May 15, 2003 12:06 am
by volka
my stupidity, that's for mysql but the question was about oracle :oops: