Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows with Oracle

0 views
Skip to first unread message

Jeff Lutes

unread,
May 3, 2002, 4:20:06 PM5/3/02
to php-w...@lists.php.net
Hello,

New to the list and have a PHP-sized headache.

I'm attempting to connect to an Oracle DB and, being totally new to PHP, was
looking for a pre-built script. What I have been finding doesn't seem to
want to run. I keep getting ORA-03121 - no interface driver connected.
Below is the snippit I've been playing with:

<?php

// load enviornment variables
putenv("ORACLE_SID=PROD");
putenv("ORACLE_HOME=C:\ORAWIN95");

// create connection

$conn = Ora_Logon("uid", "password")
or die("Couldn't logon.");

// create SQL statement
$sql = "SELECT CUSTOMER_ORDER_TAB.CUSTOMER_NO,
CUSTOMER_ORDER_TAB.CUSTOMER_PO_NO, CUSTOMER_ORDER_TAB.DATE_ENTERED,
CUSTOMER_ORDER_TAB.ORDER_NO, CUSTOMER_ORDER_TAB.WANTED_DELIVERY_DATE
FROM IFSAPP.CUSTOMER_ORDER_TAB CUSTOMER_ORDER_TAB
WHERE (CUSTOMER_ORDER_TAB.DATE_ENTERED=SYSDATE)";

// parse SQL statement
$sql_statement = Ora_Parse($connection,$sql)
or die("Couldn't parse statement.");

// execute SQL query
Ora_Execute($sql_statement)
or die("Couldn't execute statement.");

// get number of columns for use later
$num_columns = Ora_NumCols($sql_statement);

// start results formatting
echo "<TABLE BORDER=1>";
echo "<TR>
<TH>Customer Number</TH>
<TH>PO</TH>
<TH>Date</TH>
<TH>Oder Number</TH>
<TH>Wanted Delivery</TH>
</TR>
";

// format results by row
while (Ora_Fetch($sql_statement)) {
echo "<TR>";
for ($i = 0; $i < $num_columns; $i++) {
$column_value = Ora_Result($sql_statement,$i);
echo "<TD>$column_value</TD>";
}
echo "</TR>";
}

echo "</TABLE>";

// free resources and close connection
Ora_FreeStatement($sql_statement);
Ora_Logoff($connection);

?>


TIA for any assistance,

Jeff Lutes
I.S. Support Specialist
MOUS Word/Excel Expert
Hopkins Mfg. Corp.


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

Ernani Joppert Pontes Martins

unread,
Sep 18, 2002, 2:07:31 AM9/18/02
to php-w...@lists.php.net
Have you tried to install the client of Oracle on your machine ?

Winch version ?

Try to do a simple test with OCI functions...

HTH,

Ernani


"Jeff Lutes" <hopp...@hotmail.com> escreveu na mensagem
news:F10FVyf6TXip1...@hotmail.com...

0 new messages