Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2004, 03:06 PM
Authorized User
 
Join Date: Aug 2003
Location: Pittsburgh, PA, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default php oracle select

Hello.
I'm running php5 with oracle 9i.

First,I created a basic select statement to check connectivity to the oracle db and to get a result. This was successful.

Now, I modified this select statement to retrieve the information from two fields. These fields are named with dollar signs in them. I keep getting a ora_parse failed. My script and error follows....

----script------
<?php
include("conn.php");
$mysql = "select t$orno, t$cuno from orders where t$orno = 123456";
$mycursor = ora_open($conn)
ora_Parse($mycursor, $mysql, 0)
ora_Exec($mycursor)

print('<table>');
while (Ora_Fetch($mycursor)){
    printf('<tr><td>%s</td></tr>', ora_getcolumn ($mycursor, 0));
}
print('</table>');
ora_logoff($conn);
?>

----- error --------
Warning: ora_parse() [function.ora-parse]: Ora_Parse failed (ORA-00904: "T": invalid identifier -- while processing OCI function OPARSE)


-------------------
Any help is appreciated...
Thanks,
-Tim
 
Old July 2nd, 2004, 06:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's the fieldnames. I reckon $orno is coming up as an empty string, so that your statment then becomes:

select t, t from orders where t = 123456

Oracle's saying "There's no such field as 't'". Try:

echo $mysql
(a somewhat misleading name for an SQL string, if I may make so bold :)

Before you execute it. that will show what you are trying to actually run, and should make the error apparent.

Take it easy
Dan




Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to oracle from PHP paragajoshi PHP Databases 2 November 16th, 2011 05:26 PM
PHP VS Oracle junemo PHP Databases 9 June 16th, 2004 06:23 AM
Returning Oracle SELECT query results to DataSet gp_mk ADO.NET 0 December 17th, 2003 11:08 AM
CALLING ORACLE SELECT PROCEDURE danielwajnberg Oracle 1 November 20th, 2003 09:36 PM
oracle and php shakim Oracle 0 September 24th, 2003 09:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.