[PHP-DB] Retreving X, Y, Z from the Geometry column in oracle 10g
Dear all , I am stick since 2 days at the same point, I am using 10g, PHP my problem now is how to fecth the X, Y , z coordinates from the geometry column to view it on my web page, i don't understand the (SDO_ORDINATES), what is its type how i can deal with it. my simple code is: $conn=oci_connect('User','pass','//localhost/x') $sqlCol=SELECT c.GEOMETRY.SDO_ORDINATES from SSS c WHERE c.CODE = '80A' ; $resultCol=oci_parse($conn,$sqlCol); $excuteResCol=oci_execute($resultCol); $resultRecordsCol=oci_fetch_array($resultCol); I got an error on the last line as (ORA-00932: inconsistent datatypes: expected CHAR got ARRAY ) i don't know how to deal with this resultset. If anyone could help please replay. Thanks for your help
Re: [PHP-DB] Retreving X, Y, Z from the Geometry column in oracle 10g
Following is sample code. oci_fetch_array returns resultset in array form. Details are available on http://in2.php.net/manual/en/function.oci-fetch-array.php ?php $connection = oci_connect(apelsin, kanistra); $query = SELECT id, name FROM fruits; $statement = oci_parse ($connection, $query); oci_execute ($statement); while ($row = oci_fetch_array ($statement, OCI_BOTH)) { echo $row[0]. and .$row['ID']. is the samebr; echo $row[1]. and .$row['NAME']. is the samebr; } ? Santosh - Original Message - From: Hebat-Allah Farag [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Wednesday, February 20, 2008 2:01 PM Subject: [PHP-DB] Retreving X, Y, Z from the Geometry column in oracle 10g Dear all , I am stick since 2 days at the same point, I am using 10g, PHP my problem now is how to fecth the X, Y , z coordinates from the geometry column to view it on my web page, i don't understand the (SDO_ORDINATES), what is its type how i can deal with it. my simple code is: $conn=oci_connect('User','pass','//localhost/x') $sqlCol=SELECT c.GEOMETRY.SDO_ORDINATES from SSS c WHERE c.CODE = '80A' ; $resultCol=oci_parse($conn,$sqlCol); $excuteResCol=oci_execute($resultCol); $resultRecordsCol=oci_fetch_array($resultCol); I got an error on the last line as (ORA-00932: inconsistent datatypes: expected CHAR got ARRAY ) i don't know how to deal with this resultset. If anyone could help please replay. Thanks for your help -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Retreving X, Y, Z from the Geometry column in oracle 10g
You'll need an oracle - oci8 expert for this. A little googling told me that in order to use user defined data types (and i guess enhanced build in data types as GEOMETRY too) you will need oci8 functions (http://bugs.php.net/bug.php?id=39887), specifically the function bind_array_by_name() (http://usphp.com/manual/en/function.oci-bind-array-by-name.php). In general, and I bet you do, keep the oci8 function overview close (http://usphp.com/manual/en/ref.oci8.php). Evert Hebat-Allah Farag wrote: Dear all , I am stick since 2 days at the same point, I am using 10g, PHP my problem now is how to fecth the X, Y , z coordinates from the geometry column to view it on my web page, i don't understand the (SDO_ORDINATES), what is its type how i can deal with it. my simple code is: $conn=oci_connect('User','pass','//localhost/x') $sqlCol=SELECT c.GEOMETRY.SDO_ORDINATES from SSS c WHERE c.CODE = '80A' ; $resultCol=oci_parse($conn,$sqlCol); $excuteResCol=oci_execute($resultCol); $resultRecordsCol=oci_fetch_array($resultCol); I got an error on the last line as (ORA-00932: inconsistent datatypes: expected CHAR got ARRAY ) i don't know how to deal with this resultset. If anyone could help please replay. Thanks for your help -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] independent session data for multiple browser windows
They'll be accessing different account records in different windows. I keep track of the current account id in the session data, as well as a number of other account-specific items. Once I was made aware of the multiple-window requirement, and started looking more closely at sessions, it seemed (from the PHP documentation) that I could start a new session, with a different name and id, and that would take care of it. In fact I CAN start sessions with independent names and ids, but their DATA doesn't seem to be completely independent. Assuming that they are interacting through forms on the pages in the different windows, why not put the UID of the record they are accessing in a hidden field in the form? Gary -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] independent session data for multiple browser windows
On Feb 16, 2008, at 1:31 AM, Tobias Franzén wrote: Charles Whitaker wrote: Greetings, I have a nearly-completed accounts/billing database using PHP and MySQL, and was just informed that users will want to access the database via multiple windows in one browser on the same machine, so I'm looking for a way to have each browser window have its own set of session data. As far as I know, the only way for this to work reliably is if your users can manually choose to open a new session in a new window/ tab. Is this the way you want it to work? Because you can't reliably stop them from having the same session in multiple windows if they would so choose. Tobias, Thanks for the reply. With one window in Safari open, and accessing the database, they just want to create a new window (New Window in Safari's File menu) and access the database from that window as well. On the other hand, why would you require multiple sessions if they are to work against the same database? ... What kind of information stored in the session would require them to use different sessions for different tabs? If you give us a hint, we might be better able to help. They'll be accessing different account records in different windows. I keep track of the current account id in the session data, as well as a number of other account-specific items. Once I was made aware of the multiple-window requirement, and started looking more closely at sessions, it seemed (from the PHP documentation) that I could start a new session, with a different name and id, and that would take care of it. In fact I CAN start sessions with independent names and ids, but their DATA doesn't seem to be completely independent. Charles Whitaker Technical Staff Open Door Networks
Re: [PHP-DB] Retreving X, Y, Z from the Geometry column in oracle 10g
Hebat-Allah Farag wrote: I am stick since 2 days at the same point, I am using 10g, PHP my problem now is how to fecth the X, Y , z coordinates from the geometry column to view it on my web page, i don't understand the (SDO_ORDINATES), what is its type how i can deal with it. my simple code is: $conn=oci_connect('User','pass','//localhost/x') $sqlCol=SELECT c.GEOMETRY.SDO_ORDINATES from SSS c WHERE c.CODE = '80A' ; $resultCol=oci_parse($conn,$sqlCol); $excuteResCol=oci_execute($resultCol); $resultRecordsCol=oci_fetch_array($resultCol); I got an error on the last line as (ORA-00932: inconsistent datatypes: expected CHAR got ARRAY ) i don't know how to deal with this resultset. Since PHP's OCI8 deals with simple types (or arrays of simple types), you could create a mapping function in PL/SQL. There is a related example under the heading Using PL/SQL Types in PHP on page 141 of the current (1.4) version of http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf Also see the use of SDO_UTIL.GETVERTICES in http://forums.oracle.com/forums/thread.jspa?messageID=1448667#1448667 Chris -- Christopher Jones, Oracle Email: [EMAIL PROTECTED]Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/ Free PHP Book: http://tinyurl.com/f8jad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php