Re: [PHP] Showing tables (converting from MySQL to Oracle)

2005-06-23 Thread Kristen G. Thorson
This is really a question for an Oracle list, but I happen to know of 
the following page which has been helpful to me in the past:


https://gdsg.ngdc.noaa.gov/tiki/tiki-index.php?page=SqlNotes


kgt




Shane Presley wrote:


Hello,

I've recompiled PHP to use Oracle, and been able to run a quick test
script that looks like...




So now I'm going through and converting my MySQL code to Oracle.  I've
finished the connect functions, but getting hung up on how to do
queries.  For example the first query wants to SHOW TABLES.  Not sure
how to do this with Oracle calls?

function get_tables($link) {
   $tableList = array();
   $query = "SHOW TABLES";
   $result = perform_query($query, $link);
   while($row = fetch_array($result)) {
   array_push($tableList, $row[0]);
   }

   return $tableList;
}


function perform_query($query, $link) {
   if($link) {
   $result = mysql_query($query, $link) or die('Query
failed: ' . mysql_error());
   }
   else {
   die('No DB link');
   }

   return $result;
}


Thanks!
Shane

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Showing tables (converting from MySQL to Oracle)

2005-06-23 Thread Shane Presley
Hello,

I've recompiled PHP to use Oracle, and been able to run a quick test
script that looks like...




So now I'm going through and converting my MySQL code to Oracle.  I've
finished the connect functions, but getting hung up on how to do
queries.  For example the first query wants to SHOW TABLES.  Not sure
how to do this with Oracle calls?

function get_tables($link) {
$tableList = array();
$query = "SHOW TABLES";
$result = perform_query($query, $link);
while($row = fetch_array($result)) {
array_push($tableList, $row[0]);
}

return $tableList;
}


function perform_query($query, $link) {
if($link) {
$result = mysql_query($query, $link) or die('Query
failed: ' . mysql_error());
}
else {
die('No DB link');
}

return $result;
}


Thanks!
Shane

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php