Re: [PHP-DB] MySQL execution order...
Sir, it would help to see the INSERT statement and the table definition. Bob Hall I sent this message to the "general" list yesterday, and have yet to get an answer (except for that Spanish "Snow White" virus attempt from Peru). I'm trying to download info from a table as a tab-delimted text file. This part works fine. (By disabling the UPDATE statement in the code sample below, I can get the same data file sent time after time.) I need to keep the data in the table for future reference, and only want to download each new record once, so I added a DateTime field that gets updated after downloading. Then searching on that field gives me just the records that haven't been downloaded yet. The weird part is that it seems like the LAST MySQL command (UPDATE) gets executed before the FIRST one (SELECT), because the SELECT statement comes up with 0 rows. Here's some selected (modified) parts of the PHP code: First, I perform the SQL: SELECT * from db_table WHERE (DownloadedDateTime = '-00-00 00:00:00') Then, it parses and sends the info: while ($row = mysql_fetch_row($result)) { while (list($key, $val) = each($row)) { $val = ereg_replace("[\n\r\t]"," ",$val); $val = ereg_replace(" {2,}"," ",$val); echo $val . "\t"; } //end of line echo "\r"; } Then I perform the SQL: UPDATE LOW_PRIORITY db_table SET DownloadedDateTime=CURRENT_TIMESTAMP WHERE (DownloadedDateTime = '-00-00 00:00:00') -- Any ideas why the rows are getting the DownloadedDateTime field updated before they get SELECTed? Thanks, Don Johnson [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Know thyself? Absurd direction! Bubbles bear no introspection. -Khushhal Khan Khatak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] OCI 8 and rowid cause SIGSEGV
Hi there! I am using the following code on SuSE 6.4, Apache 1.3.14 and PHP 4.0.4: # $sql is dyanmically built, e.g. $sql = "select foo, bar, :rid from masterdata"; $db = OCILogOn("picht","picht"); $stmt = OCIParse($db, $sql); $rowid = OCINewDescriptor($db,OCI_D_ROWID); OCIBindByName($stmt,":rid",$rowid,-1,OCI_B_ROWID); OCIExecute($stmt); What's wrong? Am I missing something or is this a bug? Often a where clause is used for selects, but that doesn't seem to be the problem. (Can I use "where $key like '$value'"? I read somewhere not to use quotes on DB selects). Finally, here's the output from gdb: Program received signal SIGSEGV, Segmentation fault. 0x4067154f in memcpy () at ../sysdeps/generic/memcpy.c:64 64 ../sysdeps/generic/memcpy.c: Datei oder Verzeichnis nicht gefunden. [file not found...] (gdb) bt #0 0x4067154f in memcpy () at ../sysdeps/generic/memcpy.c:64 #1 0x403f3dce in ttcclr () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #2 0x403e1d0c in ttcrd2r () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #3 0x403f58e8 in ttcacs () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #4 0x403e670b in ttcdrv () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #5 0x40315e45 in nioqwa () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #6 0x40241eaa in upirtrc () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #7 0x40221571 in kpurcsc () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #8 0x40276235 in kpuexecv8 () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #9 0x4027798c in kpuexec () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #10 0x4022e4a4 in OCIStmtExecute () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #11 0x80822ed in oci_execute (statement=0x821f4ec, func=0x815cb10 "OCIExecute", mode=32) at oci8.c:1182 #12 0x8085a67 in php_if_ociexecute (ht=1, return_value=0x821f634, this_ptr=0x0, return_value_used=0) at oci8.c:3324 #13 0x810c60f in execute (op_array=0x821a814) at ./zend_execute.c:1519 #14 0x80e410b in zend_execute_scripts (type=8, file_count=3) at zend.c:729 #15 0x807c56b in php_execute_script (primary_file=0xb518) at main.c:1221 #16 0x80f0bdb in apache_php_module_main (r=0x81fbacc, display_source_mode=0) at sapi_apache.c:89 #17 0x8079b36 in send_php () #18 0x8079b76 in send_parsed_php () #19 0x8117289 in ap_invoke_handler () #20 0x812c4ff in process_request_internal () #21 0x812c572 in ap_process_request () #22 0x8123416 in child_main () #23 0x81235d5 in make_child () #24 0x8123756 in startup_children () #25 0x8123dcd in standalone_main () #26 0x81245fc in main () #27 0x40632a5e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93 Cheerio, Sven -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Re: sessions
Configure PHP with this line included --enable-trans-sid This will automatically put the session ID after every URL if the user does not have cookies enabled. Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here This could be because cookies have been disabled. Can I find a way such that my code works even if cookies have been disabled ??
AW: [PHP-DB] Re: sessions
configure apache with modrewrite and configure it to rewrite a request URL like http://domain/DUMMY/1234109809--cookiedata---123412341234/file to localfile url /home/apache/triggeredpath/file or use one php-file for your total website (maybe modular with includes), then you can build URLS like file.php/cookiedata/balbladf?param=adfa the /cookiedata.. part will be stored in $PATH_INFO and $param will be set t adfa (just as you know it) (note:things may defer if your using php as cgi) -Ursprngliche Nachricht- Von: Hoover, Josh [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 23. Februar 2001 15:00 An: 'Pankaj Ahuja'; php-db list Betreff: RE: [PHP-DB] Re: sessions Configure PHP with this line included --enable-trans-sid This will automatically put the session ID after every URL if the user does not have cookies enabled. Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here This could be because cookies have been disabled. Can I find a way such that my code works even if cookies have been disabled ?? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] SQL finding a date problem
Try this: SELECT * from schedule WHERE EST_DATE = '2001-03-26'; By the way, what Database are you using? Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here Can someone tell me how to search for a date with SQL? I have tried the following SELECT * from schedule WHERE EST_DATE = '03/26/2001'; I get the error Incompatible datatypes in expression : = , SQL state 37000 Thanks.
Re: [PHP-DB] OCI 8 and rowid cause SIGSEGV
I suppose the authors never concieved a replacement parameter for select specification. try: $sql = "select foo, bar, rid from masterdata WHERE rid=:rid" You need to loose the colon ":" or place it to the right of a where clause. [EMAIL PROTECTED] wrote in message F114C0EF28F3D211B7E84000610104461D3D44@XNT-FRALIC-9">news:F114C0EF28F3D211B7E84000610104461D3D44@XNT-FRALIC-9... Hi there! I am using the following code on SuSE 6.4, Apache 1.3.14 and PHP 4.0.4: # $sql is dyanmically built, e.g. $sql = "select foo, bar, :rid from masterdata"; $db = OCILogOn("picht","picht"); $stmt = OCIParse($db, $sql); $rowid = OCINewDescriptor($db,OCI_D_ROWID); OCIBindByName($stmt,":rid",$rowid,-1,OCI_B_ROWID); OCIExecute($stmt); What's wrong? Am I missing something or is this a bug? Often a where clause is used for selects, but that doesn't seem to be the problem. (Can I use "where $key like '$value'"? I read somewhere not to use quotes on DB selects). Finally, here's the output from gdb: Program received signal SIGSEGV, Segmentation fault. 0x4067154f in memcpy () at ../sysdeps/generic/memcpy.c:64 64 ../sysdeps/generic/memcpy.c: Datei oder Verzeichnis nicht gefunden. [file not found...] (gdb) bt #0 0x4067154f in memcpy () at ../sysdeps/generic/memcpy.c:64 #1 0x403f3dce in ttcclr () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #2 0x403e1d0c in ttcrd2r () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #3 0x403f58e8 in ttcacs () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #4 0x403e670b in ttcdrv () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #5 0x40315e45 in nioqwa () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #6 0x40241eaa in upirtrc () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #7 0x40221571 in kpurcsc () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #8 0x40276235 in kpuexecv8 () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #9 0x4027798c in kpuexec () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #10 0x4022e4a4 in OCIStmtExecute () from /zwei/oracle/u01/app/oracle/product/8.1.6/lib/libclntsh.so.8.0 #11 0x80822ed in oci_execute (statement=0x821f4ec, func=0x815cb10 "OCIExecute", mode=32) at oci8.c:1182 #12 0x8085a67 in php_if_ociexecute (ht=1, return_value=0x821f634, this_ptr=0x0, return_value_used=0) at oci8.c:3324 #13 0x810c60f in execute (op_array=0x821a814) at ./zend_execute.c:1519 #14 0x80e410b in zend_execute_scripts (type=8, file_count=3) at zend.c:729 #15 0x807c56b in php_execute_script (primary_file=0xb518) at main.c:1221 #16 0x80f0bdb in apache_php_module_main (r=0x81fbacc, display_source_mode=0) at sapi_apache.c:89 #17 0x8079b36 in send_php () #18 0x8079b76 in send_parsed_php () #19 0x8117289 in ap_invoke_handler () #20 0x812c4ff in process_request_internal () #21 0x812c572 in ap_process_request () #22 0x8123416 in child_main () #23 0x81235d5 in make_child () #24 0x8123756 in startup_children () #25 0x8123dcd in standalone_main () #26 0x81245fc in main () #27 0x40632a5e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93 Cheerio, Sven -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] onMouseOver onMouseOut
Is there such a function for PhP ? I want to replace some javasctiripts with PhP, but there are quite a few onmouseover events. Thank you Rudi "Opinions expressed do not necessarily represent the views of my employer." -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] onMouseOver onMouseOut
Remember, php is server side while JavaScript is client side. You can't use php client side. You can use some client side events to call php scripts which will run on the server and send data to the browser. Events are client side, so try JavaScript you'll enjoy it too. HTH Jayme. -Mensagem Original- De: Rudi Ahlers [EMAIL PROTECTED] Para: PhP List [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de fevereiro de 2001 14:00 Assunto: [PHP-DB] onMouseOver onMouseOut Is there such a function for PhP ? I want to replace some javasctiripts with PhP, but there are quite a few onmouseover events. Thank you Rudi "Opinions expressed do not necessarily represent the views of my employer." -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] onMouseOver onMouseOut
At 06:27 PM 2/23/2001 -0300, you wrote: Remember, php is server side while JavaScript is client side. You can't use php client side. You can use some client side events to call php scripts which will run on the server and send data to the browser. Events are client side, so try JavaScript you'll enjoy it too. Also keep in mind that Javascript should *never* be relied upon for input validation. It is trivial to disable Javascript on the client side (and there are very good reasons for doing so, drop by www.securityfocus.com sometime for reasons why) and you cannot trust any data that comes from the end user. I personally would never recommend Javascript "crippling" your site - it should run perfectly without it since support varies from browser to browser (not everyone uses the latest version of IE) and you have no guarantee that it will be enabled client side at all. That's not even getting into people building URLs by hand for "kicks". Since you have to perform input validation server side anyway, this makes Javascript pretty much useless for this purpose. Javascript is really only useful for display effects that do not affect accessibility which means they should be avoided most of the time just like Macromedia Flash, Quicktime, etc. unless you are 100% sure your audience meets your site's requirements exactly. All IMHO of course. Cheers, Ron - Island Net AMT Solutions Group Inc. Telephone: 250 383-0096 1412 Quadra Toll Free:1 800 331-3055 Victoria, B.C. Fax:250 383-6698 V8W 2L1 E-Mail:[EMAIL PROTECTED] Canada WWW: http://www.islandnet.com/ - -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Can PHP read View in stead of Table?
Dear Andrew, I have followed your instruction to comment out the #define statement. PHP/Apache can recompile smoothly but PHP still need key to search the table so that I cannot access View. Moreover, I found that when I propose SQL statement using "group by", error printed : "SQL error: [OpenLink][ODBC][Driver]Syntax error or access, SQL state 37000 in SQLExecDirect". It seems that PHP_ODBC function does not support "group by" statement. Do you have any suggestions? Thanks for your help! Peter From: "Andrew Hill" [EMAIL PROTECTED] on 22.02.2001 10:14 PM Please respond to [EMAIL PROTECTED] To: WC Ip/ITSD/HKSARG@ITSD, [EMAIL PROTECTED] cc: Subject: RE: [PHP-DB] Can PHP read View in stead of Table? Peter. It is not a bug in OpenLink's driver but in PHP - odbc_connect is setting a cursor by default when you connect. This is usually fine, but a cursor needs a primary key. If no primary key exists, there will be a problem. This of course will always be a problem with views, as running a cursor against a view makes very little sense. There is a workaround to prevent odbc_connect from automatically selecting a cursor type when connecting - edit php_odbc.h and comment out: #define HAVE_SQL_EXTENDED_FETCH 1 and recompile your php/apache setup. Hope this helps! Best regards, Andrew -- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.com -Original Message- From: WC Ip [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 11:22 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Can PHP read View in stead of Table? Dear all, I have install PHP on Linux and use Openlink ODBC Driver to link to MS SQL server on Windows NT. Just now I can read data from Table on SQL server. However, when I make View on the same database, I can't use PHP to extract data from this View. When I do query on the View, error message shown: Warning: SQL error: [OpenLink][ODBC][Driver]No key columns found for table referenced by keyset driven cursor., SQL state IM909 in SQLExecDirect in /usr/local/apache_1.3.12/htdocs/internet.php on line 42 The possible problem may due to primary key of table. As testing, I found the table with primary i can access easily. However, when i remove primary key from the same table, error has shown and cannot show data. May I solve this problem or this is the bugs of openlink ODBC driver? Thanks for your help!!! Peter -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]