ASP and PHP connection to ORACLE

I am trying to connect to Oracle database.
Howevery i found it difficult as i don’t know what to type for:

For ASP:

Server.CreateObject("[COLOR=red]ADODB.Connection[/COLOR]")

and

conn.Open “[COLOR=red]Driver={Microsoft Access Driver (*.mdb)};” & _
“DBQ=” & MyPath[/COLOR]

FOR php:

$link = mysql_connect([COLOR=red]dbhost[/COLOR], dbuser, dbpassword)

[COLOR=red]$desiredContent = mysql_fetch_array($result, MYSQL_ASSOC);[/COLOR]
[COLOR=red]mysql_free_result($result);[/COLOR]

What are them respectively and what should i type to connect to oracle??

Which of them are easier to implement???

:puzzled:

You do know you have to pay for Oracel database’s. Why not use MySQL?

Actually i am doing a school project and the university provides me oracle to use. I learnt using servlet to connect the database but i have no idea on using php or asp :diss:

$host = “”;
$username = “”;
$password = “”;
$database = “”;

$connect = mysql_connect($host, $username, $password);
$select_database = mysql_select_db($database, $connect);

Dunno id this woks for oracle but works for mysql :stuck_out_tongue:

:smirk: yup~~
But it gave me hard time in think about the $host of oracle. And i don’t have to choose a database to use Oracle too.

Its confusing.

I believe it’s actually odbc_connect() for PHP. I don’t have any personal experience with Oracle, however I’ve looked a bit into it.

odbc_autocommit – Toggle autocommit behaviour
odbc_binmode – Handling of binary column data
odbc_close_all – Close all ODBC connections
odbc_close – Close an ODBC connection
odbc_columnprivileges – Returns a result identifier that can be used to fetch a list of columns and associated privileges
odbc_columns – Lists the column names in specified tables
odbc_commit – Commit an ODBC transaction
odbc_connect – Connect to a datasource
odbc_cursor – Get cursorname
odbc_data_source – Returns information about a current connection
odbc_do – Synonym for odbc_exec()
odbc_error – Get the last error code
odbc_errormsg – Get the last error message
odbc_exec – Prepare and execute a SQL statement
odbc_execute – Execute a prepared statement
odbc_fetch_array – Fetch a result row as an associative array
odbc_fetch_into – Fetch one result row into array
odbc_fetch_object – Fetch a result row as an object
odbc_fetch_row – Fetch a row
odbc_field_len – Get the length (precision) of a field
odbc_field_name – Get the columnname
odbc_field_num – Return column number
odbc_field_precision – Synonym for odbc_field_len()
odbc_field_scale – Get the scale of a field
odbc_field_type – Datatype of a field
odbc_foreignkeys – Returns a list of foreign keys in the specified table or a list of foreign keys in other tables that refer to the primary key in the specified table
odbc_free_result – Free resources associated with a result
odbc_gettypeinfo – Returns a result identifier containing information about data types supported by the data source
odbc_longreadlen – Handling of LONG columns
odbc_next_result – Checks if multiple results are available
odbc_num_fields – Number of columns in a result
odbc_num_rows – Number of rows in a result
odbc_pconnect – Open a persistent database connection
odbc_prepare – Prepares a statement for execution
odbc_primarykeys – Returns a result identifier that can be used to fetch the column names that comprise the primary key for a table
odbc_procedurecolumns – Retrieve information about parameters to procedures
odbc_procedures – Get the list of procedures stored in a specific data source
odbc_result_all – Print result as HTML table
odbc_result – Get result data
odbc_rollback – Rollback a transaction
odbc_setoption – Adjust ODBC settings
odbc_specialcolumns – Returns either the optimal set of columns that uniquely identifies a row in the table or columns that are automatically updated when any value in the row is updated by a transaction
odbc_statistics – Retrieve statistics about a table
odbc_tableprivileges – Lists tables and the privileges associated with each table
odbc_tables – Get the list of table names stored in a specific data source

~PHP manual OBDC function table of contents.

Actually, it’s probably the OCI8 extension you want to use :wink:

Yeah and if you use odbc you are going to have to go into the server admin tools and specify the database you are going to use, if you are using a windows based machine, not sure about linux.

you might wanna look into adodb. ADOdb is a database abstraction library for PHP. It also supports Oracle.

Ditto on ADOdb (or PEAR::DB) - there is a bit of pain in connecting and talking to an oracle DB using base PHP functions.