Reply to Re: Showing tables (converting from MySQL to Oracle)

Your name:

Reply:


Posted by Catalin Trifu on 10/21/87 11:19

Hi,

the USER_TABLES view shows all tables in oracle. Take a look at adodb.sf.net
for a very nice php library for database access. It takes much of the porting
burden off your shoulders and is pretty fast.

Catalin


Shane Presley wrote:
> Hello,
>
> I've recompiled PHP to use Oracle, and been able to run a quick test
> script that looks like...
>
> <?php
> if ($c=OCILogon("user", "pw", "server")) {
> echo "Successfully connected to Oracle.\n";
> OCILogoff($c);
> } else {
> $err = OCIError();
> echo "Oracle Connect Error " . $err[text];
> }
> ?>
>
>
> 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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация