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
retrieve record from Oracle by its position?
Moderator: General Moderators
-
jiehuang001
- Forum Commoner
- Posts: 39
- Joined: Mon May 12, 2003 12:53 pm
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,'];my stupidity, that's for mysql but the question was about oracle
- Take a look at
- http://www.php.net/manual/en/function.ocifetchinto.php (there's an example)
- http://www.php.net/manual/en/ref.oci8.php (LXXI. Oracle 8 functions)
- maybe also http://www.php.net/manual/en/ref.oracle.php