[PHP-DB] Re: oci_bind_by_name, 'Unknown or unsupported datatype given'
Okay, its seems my problem is actually more fundamental. I've just tried to run the example from the oci_bind_by_name documentation on php.net, and get the same error! The example doesn't work for me. I think at this point I need to assume there is something wrong with the server settings? Maybe Apache needs certain configurations in order for this to work? Anyone have any idea whats causing this? This is the page with the example I tried to run: http://uk.php.net/manual/en/function.oci-bind-by-name.php And this is the output from it: Warning: oci_bind_by_name() [function.oci-bind-by-name]: Unknown or unsupported datatype given: 1 in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 28 Warning: oci_bind_by_name() [function.oci-bind-by-name]: Unknown or unsupported datatype given: 1 in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 29 Warning: oci_bind_by_name() [function.oci-bind-by-name]: Unknown or unsupported datatype given: 1 in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 41 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 46 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 47 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 46 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 47 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 46 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 47 On 8/9/05, Anton Channing [EMAIL PROTECTED] wrote: I am currently building a php-oracle application for the college I work for, and as part of that application I have cause to to create some insert/update procedures. My best solution for this is to have an input/output parameter representing the id of the field that needs to updated. This works fine. ... And finally, this is the error I get (including a stack trace): An error has occurred and the page has not loaded correctly. Please try and refresh/reload the page. If the error persists, then please contact MIS and we will look into the problem. errno: 2 errstr: oci_bind_by_name() [a href='function.oci-bind-by-name'function.oci-bind-by-name/a]: Unknown or unsupported datatype given: 1 errfile: D:\Apache Group\Apache2\htdocs\Learner_Support_Fund\update_equipment.php errline: 77 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: oci_bind_by_name, 'Unknown or unsupported datatype given'
Anton, This seems so fundamental I hesitate to suggest it. Have you run a script with phpinfo() in it? Or apache or httpd with the -l, -V or -t switches? Miles At 06:59 AM 8/10/2005, Anton Channing wrote: Okay, its seems my problem is actually more fundamental. I've just tried to run the example from the oci_bind_by_name documentation on php.net, and get the same error! The example doesn't work for me. I think at this point I need to assume there is something wrong with the server settings? Maybe Apache needs certain configurations in order for this to work? Anyone have any idea whats causing this? This is the page with the example I tried to run: http://uk.php.net/manual/en/function.oci-bind-by-name.php And this is the output from it: Warning: oci_bind_by_name() [function.oci-bind-by-name]: Unknown or unsupported datatype given: 1 in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 28 Warning: oci_bind_by_name() [function.oci-bind-by-name]: Unknown or unsupported datatype given: 1 in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 29 Warning: oci_bind_by_name() [function.oci-bind-by-name]: Unknown or unsupported datatype given: 1 in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 41 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 46 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 47 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 46 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 47 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 46 Warning: oci_execute() [function.oci-execute]: OCIStmtExecute: ORA-01008: not all variables bound in D:\Apache Group\Apache2\htdocs\test\oci_bind_by_name.php on line 47 On 8/9/05, Anton Channing [EMAIL PROTECTED] wrote: I am currently building a php-oracle application for the college I work for, and as part of that application I have cause to to create some insert/update procedures. My best solution for this is to have an input/output parameter representing the id of the field that needs to updated. This works fine. ... And finally, this is the error I get (including a stack trace): An error has occurred and the page has not loaded correctly. Please try and refresh/reload the page. If the error persists, then please contact MIS and we will look into the problem. errno: 2 errstr: oci_bind_by_name() [a href='function.oci-bind-by-name'function.oci-bind-by-name/a]: Unknown or unsupported datatype given: 1 errfile: D:\Apache Group\Apache2\htdocs\Learner_Support_Fund\update_equipment.php errline: 77 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: oci_bind_by_name, 'Unknown or unsupported datatype given'
At 11:32 AM 8/10/2005, Anton Channing wrote: On 8/10/05, Miles Thompson [EMAIL PROTECTED] wrote: Anton, This seems so fundamental I hesitate to suggest it. Have you run a script with phpinfo() in it? Or apache or httpd with the -l, -V or -t switches? Miles Okay, have just run phpinfo, obviously it prints out a whole load of stuff, what am I looking for? I hesitate to do anything with the server. Unfortunately my colleague that deals with the server is on holiday, so if the phpinfo output can help, it would be good if I can work something out from that. Also, we are lacking a test server at the moment, so the only changes I can make are to the live one... :) Anton Please reply to the list ... Well, it tells you what PHP has been compiled with, Apache configuration, and further down what database support is available. The reason for running phpinfo() and Apache or httpd with those command line switches is that it tells you what support for Oracle is available from the web server side. Presumably there are similar functions built into Oracle. Never having used Oracle, I cannot tell you what to look for, but there is some basic information here which should help with your diagnosis. Regards - Miles -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Connecting to SQL Server
I have been asked by my client to use SQL Server for my php application (uh!). The name of the server is 2k-server, but I am not sure where to create the ODBC connection. Some of the docs state that all I need is ?php $connection_string = 'DRIVER={SQL Server};SERVER=2K-SERVER;DATABASE=Php_Test'; $user = 'sa'; $pass = 'MyPassword'; $connection = odbc_connect( $connection_string, $user, $pass ); ? However that gives me an error: Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /home/httpd/test/odbc/php/connect.php on line 8 Any suggestions on the best way to connect? Todd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connecting to SQL Server
Hi Todd, PHP has native support for MSSQL Server. On a *nix platform you need to install and configure FreeTDS and recompile php using --with-mssql, but then you will be able to use the mssql_* functions. - Frank I have been asked by my client to use SQL Server for my php application (uh!). The name of the server is 2k-server, but I am not sure where to create the ODBC connection. Some of the docs state that all I need is ?php $connection_string = 'DRIVER={SQL Server};SERVER=2K-SERVER;DATABASE=Php_Test'; $user = 'sa'; $pass = 'MyPassword'; $connection = odbc_connect( $connection_string, $user, $pass ); ? However that gives me an error: Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /home/httpd/test/odbc/php/connect.php on line 8 Any suggestions on the best way to connect? Todd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connecting to SQL Server
If I remember right, PHP's built-in database functions don't allow for a DSNLess connection. Meaning you have to set up an ODBC source on the machine PHP is running on (or do a remote ODBC connection) and connect to a DSN (a named datasource manually set up). BUT.. if you know the address of the server and all the login information, you can do a DSNLess connection. At my last job I used PHP on an IIS server to connect to a couple SQL Servers and an Oracle server using ADODB for PHP. I posted about it ages ago.. here's a link to an archived message where I posted my DSN config file. Down here it says Cargo System databases you'll find examples that might help. Sorry to be vague, but hopefully it's a start for you. Once you get it configured, it should work fairly fluidly. -TG = = = Original message = = = I have been asked by my client to use SQL Server for my php application (uh!). The name of the server is 2k-server, but I am not sure where to create the ODBC connection. Some of the docs state that all I need is ?php $connection_string = 'DRIVER=SQL Server;SERVER=2K-SERVER;DATABASE=Php_Test'; $user = 'sa'; $pass = 'MyPassword'; $connection = odbc_connect( $connection_string, $user, $pass ); ? However that gives me an error: Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /home/httpd/test/odbc/php/connect.php on line 8 Any suggestions on the best way to connect? Todd ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] SELECT Performance and INDEXing
I have a MyISAM table holding images with field types bigint(20), mediumblob, varchar(255), blob and tinyint(3). The table has grown to over 800 MB and over 6,000 rows. In the past week, performance has been about 15-20 seconds to run the following select statement which pulls only 16 maximum rows: SQL1) SELECT field1, field2, andUpToField10 FROM theTable WHERE field2 = $aField2Value OR field1 = 1 OR field1 = 2 ORDER BY field1 ASC Basically I always pull the first 2 images in the table via the primary key field1 and upto 14 additional images depending on a foreign key field2. field2 can have up to 14 repeated/duplicate entries. My working solution is that I have since split this into 2 select statements: SQL2) SELECT field1, field2, andUptoField10 FROM theTable WHERE field1 = 1 OR field1 = 2 ORDER BY field1 ASC SQL3) SELECT field1, field2, andUptoField10 FROM theTable WHERE field2 = $aField2Value ORDER BY field1 ASC and performance is back to instantaneous (as far as web responsiveness is concerned). Can someone explain why SQL1 took so long to run as compared with running SQL2 and SQL3 ? Before splitting the statements, I also tried from phpmyadmin (Check table, Aalyze table, Optimize table) and creating an INDEX on field2, but I noticed no performance increase. Before explicitly adding an INDEX, the space usage in phpmyadmin already showed Type:Index using several bytes. The table still has the INDEX I explicitly created. Can someone explain to me INDEXing ? I was thinking of field2 and field3 for an INDEX (since field3 holds a number from 1 - 14 and the composite key field1 field2 would be unique), but I seem to be home free already. I would just like to know why performance slowed and then why it improved with my solution. Regards.
Re: [PHP-DB] SELECT Performance and INDEXing
I meant 'Analyze table' and 'the composite key field2 field3 would be unique' - Original Message - From: Dwight Altman [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Wednesday, August 10, 2005 4:23 PM Subject: [PHP-DB] SELECT Performance and INDEXing I have a MyISAM table holding images with field types bigint(20), mediumblob, varchar(255), blob and tinyint(3). The table has grown to over 800 MB and over 6,000 rows. In the past week, performance has been about 15-20 seconds to run the following select statement which pulls only 16 maximum rows: SQL1) SELECT field1, field2, andUpToField10 FROM theTable WHERE field2 = $aField2Value OR field1 = 1 OR field1 = 2 ORDER BY field1 ASC Basically I always pull the first 2 images in the table via the primary key field1 and upto 14 additional images depending on a foreign key field2. field2 can have up to 14 repeated/duplicate entries. My working solution is that I have since split this into 2 select statements: SQL2) SELECT field1, field2, andUptoField10 FROM theTable WHERE field1 = 1 OR field1 = 2 ORDER BY field1 ASC SQL3) SELECT field1, field2, andUptoField10 FROM theTable WHERE field2 = $aField2Value ORDER BY field1 ASC and performance is back to instantaneous (as far as web responsiveness is concerned). Can someone explain why SQL1 took so long to run as compared with running SQL2 and SQL3 ? Before splitting the statements, I also tried from phpmyadmin (Check table, Aalyze table, Optimize table) and creating an INDEX on field2, but I noticed no performance increase. Before explicitly adding an INDEX, the space usage in phpmyadmin already showed Type:Index using several bytes. The table still has the INDEX I explicitly created. Can someone explain to me INDEXing ? I was thinking of field2 and field3 for an INDEX (since field3 holds a number from 1 - 14 and the composite key field1 field2 would be unique), but I seem to be home free already. I would just like to know why performance slowed and then why it improved with my solution. Regards. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php