[PHP-DB] 1 TNS error out of 25 connections
HI I have a strange behaviour of my remote Apache-PHP-Oracle-Client. Apache 1.3.14 mod SSL PHP 4.0.3pl1 (everything compiled from sources) Oracle 8.1.6 on remote Intel/Redhat 6.2 (100MBit, same subnet) The Oracle Server runs a Multi-Threaded-Server (successfully) and accepts dedicated Serverconnections on the same Port. tnsnames.ora and sqlnet.ora are placed in the proper directories. it works in 95% of all requests, but sometimes (with no specific traffic reason or network problem) it shows an typical _oci_openserver_error: COULD NOT RESOLVE SERVICE NAME. I looked up Oracles Online Help but it's just like check your tnsnames.ora, check your servicename ... But as it works in 95% of all cases, I do not think that the problem is my path to tnsnames.ora Is there anyone that is familiar with that problem or the configuration of MTS and Dedicated at the same port / time ? thank you mk -- 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]
AW: [PHP-DB] PHP: Good for articles?
Another Question: Can users via PHP update field data in a MySQL database? I would really appreciate any comments. PHP and MySQL (at standard ISPs) is a good (the best) choice for your business. It's cheap, fast and reliable, although i would not take my mission critical parts to an ISP. check out: http://www.phpwizard.net/projects/phpMyAdmin/ phpMyAdmin is a DB-Manager for MySql completely written in PHP. You can do everything with that and so can you with your PHP-Script mk -- 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]
AW: [PHP-DB] Oracle Function Calls
YOu have to form proper SQL-Statements try to parse and execute: select foo_function ('paramstr', 999) from dual; dual is a dummy table; then fetch the resultrow and ociresult($stmt, 1) will return your functionreturnvalue mk -Ursprungliche Nachricht- Von: Richard S. Crawford [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 7. Marz 2001 22:11 An: [EMAIL PROTECTED] Betreff: [PHP-DB] Oracle Function Calls Ah! My bad! I sent this question out with the wrong subject line. My apologies to everyone that I confused. At 01:07 PM 3/7/01 -0800, Richard S. Crawford wrote: I desperately need to know whether it is possible to call an Oracle function in PHP. For example... $functionResult=hubins($name,$commit_yn) where hubins is a stored procedure in our Oracle database. Can this be done? My first thought was to do something like this: $functionCall="hubins($name,$commit_yen)"; then then do ociexecute($functionCall); ...but that, of course didn't work. Any thoughts? -- 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] -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow -- 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]
AW: AW: [PHP-DB] Oracle Function Calls
Oracle Divides Function in several Groups DML means Data-Manipulating function; (in your funciton is a update or insert) to use a function in a query it needs to be "pure" only selects and arithmetics you can rewrite this function to a procedure and return your value as an out parameter $stmt = ociparse($dbh,"BEGIN p_foo_procedure('param_in',:1);END;" ); OCIBindByName ($stmt,":1",$outparam,40); ociexecute ($stmt); OCIfreestatement($stmt); 40 is the buffer in chars/bytes (addjust if needed) the procedure needs to declare the second argument as in and can declare the second one as "out" or "in out" mk -Ursprungliche Nachricht- Von: Richard S. Crawford [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 7. Marz 2001 22:46 An: [EMAIL PROTECTED] Betreff: Re: AW: [PHP-DB] Oracle Function Calls Here is the error that I get when I try this approach: ORA-14551: cannot perform a DML operation inside a query At 10:26 PM 3/7/01 +0100, Matthias Kopolt wrote: YOu have to form proper SQL-Statements try to parse and execute: select foo_function ('paramstr', 999) from dual; dual is a dummy table; then fetch the resultrow and ociresult($stmt, 1) will return your functionreturnvalue mk -Ursprungliche Nachricht- Von: Richard S. Crawford [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 7. Marz 2001 22:11 An: [EMAIL PROTECTED] Betreff: [PHP-DB] Oracle Function Calls Ah! My bad! I sent this question out with the wrong subject line. My apologies to everyone that I confused. At 01:07 PM 3/7/01 -0800, Richard S. Crawford wrote: I desperately need to know whether it is possible to call an Oracle function in PHP. For example... $functionResult=hubins($name,$commit_yn) where hubins is a stored procedure in our Oracle database. Can this be done? My first thought was to do something like this: $functionCall="hubins($name,$commit_yen)"; then then do ociexecute($functionCall); ...but that, of course didn't work. Any thoughts? -- 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] -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow -- 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] -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow -- 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]
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]
AW: [PHP-DB] SQL Select statement
think you can give your problem another approach, splitting it in two queries and joining the result sets through php script. Sometimes you can't put SQL to do all the work. That's true, but in most cases it is more efficient to leave the joins, orders etc. in the DB, because its more optimzed for such dumb processes ... mk -- 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]
AW: [PHP-DB] SQL Select statement
try something like: select a.memberID from table a, table b where a.choice=2 and b.choice=3 and a.memberID = b.memberID; or select memberID, count(*) from table where choice=2 or choice=3 group by memberID having count(*) = 2; (i don't know what is more effizient, might depend on your indexes and the amount. the second sql asumes you only have one row per memberID - choice (noone should choose 3 2times ore more) mk -Ursprungliche Nachricht- Von: bill [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 17. Februar 2001 02:45 An: [EMAIL PROTECTED] Betreff: [PHP-DB] SQL Select statement I have a table with three simple columns: id(unique), memberID, and choice I want to find out which memberIDs have BOTH choice 2 AND choice 3. -- SELECT memberID from table where choice=2 AND choice = 3 That won't work (0 results, of course, because no row has two choices, they're mutually exclusive) --- SELECT memberID from table where choice=2 OR choice = 3 That doesn't work (shows all memberIDs that chose either 2 or 3). Can I maybe join the table upon itself on the memberID? Other suggestions? thanks, bill hollett -- 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]
AW: [PHP-DB] php, OCI and datatypes
use the display sourcecode function of your browser, it is more reliable than the output. try to get the char column with ocifetch($stmt); $charcol = ociresult($stmt, "nameofcharcol"); maybe your using [] the wrong way so you are getting the chars of the string instead of the strings in the row mk -Ursprungliche Nachricht- Von: dsi safir [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 14. Februar 2002 10:23 An: [EMAIL PROTECTED] Betreff: [PHP-DB] php, OCI and datatypes Hi, I'm working with Oracle 8.05 and php4.04xx. I'm selecting some datas in order to show them in a browser (Netscape 4.03Fr or IE5.0). I found out that my code works well with all datatypes but CHAR. Varchar2, date or numbers are retrieved and rendered in an array without any problems. With a char column, I can't see any values with Netscape and with IE, I have less than half of the string or nothing. Example : select char_column, other_column from my_table; // the query, char_column as a char(5) not null The output with OCIFetchStatement or OCIFetchInto or else is made with something like TD$data[$i]/TD. The char column is filled with a blank space on the first row. On the second row, the char column is filled with a blank space between half of the initial string. and so on... Example : for "Hello" in the table, I get " H e l".(with IE, with Netscape I get nothing at all). So, any ideas ? Emmanuel Nectoux -- 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]
AW: [PHP-DB] How can I have connection pooling in PHP?
you can use persistent connections or you can have the db-Environment do that for you, e.g. COnnectionManager or ConenctionPooling of oracles NET8 mk -Ursprngliche Nachricht- Von: Christopher Cheng [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 14. Februar 2001 11:27 An: [EMAIL PROTECTED] Betreff: [PHP-DB] How can I have connection pooling in PHP? I am wondering whether I can have connection pooling in PHP like Java? -- 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] Oracle, Stored Procedure Out Variable confusion
confusion: Using PHP 4.0.3pl1 with oci8 libraries and Oracle 8.1.6 there seems to be problem when retrieving OUT-Variables from stored procedure, bind to a variable. for example i got an error retrun value (parsed to SQL as :1 and bind to $error with a buffer of 4) it could !! happen that $error looks like 0 [zero] but is not a [zero] but something else sometime $error == 0 is true, sometimes it false ... WOrkaraund: using it as a string helped "$error" == "0" is always true when $error looks like a zero. there is no sign of some extra spaces or invisible chars. strlen is always 1 and print always prints 0. But sometimes zero isn#t less enough ... ;-) Did someone else face this problem or do you know if this is fixed in later releases or if this a special NET8 remote DB on linux and client on solaris problem ? mk -- 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]
AW: [PHP-DB] php and OCI
you can use the meta column rownum e.g. where rownum20 note: you need to do subselects and (where rownum 1) will never return a line !!! you could use something like select * from select rownum "rownumber", mydata from mytable order by mycol ) where rownumber 10 and rownumber 20; should work ... 2. i know there is a phpfunction for that ocifetchedrows or something like that mk -Ursprungliche Nachricht- Von: Valerio Ferrucci [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 13. Februar 2001 12:54 An: [EMAIL PROTECTED] Betreff: [PHP-DB] php and OCI Hi, I'm using php with oracle to select data in a db. 1) My code is: putenv("ORACLE_HOME=/xx"); putenv("ORACLE_SID=xx"); $conn = ociLogon("xx","xx","xx"); $st = ociparse($conn,"select * from myTable order by MYFIELD"); $res = ociexecute($st,OCI_DEFAULT); while(ocifetch($st)) { ... } This is ok, BUT: I want to show records in pages with 20 records each one. How can I obtain this? I see that php asks all thousands records to (remote) oracle server, slowing time. Is there something like: ociexecute($st,OCI_DEFAULT, fromRec, toRec); 2) How can I know the total records in current selection? Thanks == Valerio FerrucciTabasoft Sas [EMAIL PROTECTED] http://tabasoft.ancitel.it [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 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]
AW: AW: AW: [PHP-DB] php and OCI
OK: imagine you want to find all rows where COLOR = 'foo' : $st1 = ociparse ($conn, "SELECT count(*) FROM myTable WHERE COLOR = 'foo'"); ociexecute($st1,OCI_DEFAULT); ocifetch ($st1); $number_of_rows = ociresult ($st1, 1); //e.g. 372 $st2 = ociparse ($conn, "SELECT ID, NAME FROM myTable WHERE COLOR = 'foo'"); ociexecute($st2,OCI_DEFAULT); while (ocifetch($st2)) { echo "hr ID : ".ociresult ($st2, 1); echo "br NAME : ".ociresult ($st2, 2); } //this will return about 372 datarows $st3 = ociparse ($conn, "SELECT ID, NAME FROM myTable WHERE COLOR = 'foo' AND ROWNUM = 10"); ociexecute($st1,OCI_DEFAULT); while (ocifetch($st3)) { echo "hr ID : ".ociresult ($st3, 1); echo "br NAME : ".ociresult ($st3, 2); } //this will return max 10 datarows //remember to ocifreestatement($st..) every ressource when duing continuos queries /* rownum is a metacolumn that is a signed during retrieving data from database, but before sorting it. so " where rownum 11 order by points desc " will not give you the top ten but, the first 10 entries in the list, ortderd by points. to overcom that do subselects : "select * from (select * from table where foocondition order by foo) where rownum 10 " mk -- 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]
AW: AW: AW: AW: [PHP-DB] php and OCI
and to get rows, say, from 20 to 40? Is it ok to write: "select * from (select * from table where foocondition order by foo) where rownum = 20 AND rownum = 40" its not that easy, as oracle start counting with the first retrieved row, so rownum x will wait for ever, as oracle will never start counting because no rows are retrieved. make a trick and select the rownum in a subquery, than you can treat it as a fixed row: select * from ( select rownum "rn", * from (select * from table where foocondition order by foo) ) where rn = 20 AND rn = 40 this should do it (although there are a lot of subqueries) -- 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]
AW: [PHP-DB] Oracle connectivity
http://www.php.net/manual/en/function.ocilogon.php tells you int OCILogon (string username, string password [, string db]) so i assume that TEST is your User, web the password and pwd the TNS-Identifier ? I have a 8.1.6 DB (i guess thats what you have too), i#m using OCI8 libaries and connecting to that remote server from more than 10!! different Machines on the network, using PHP, JDBC and various Management Tools. It does work believe me - Although sometimes it is difficult to set it, since there are quite a few things that can go wrong. the TNS names must match, (consider that a default_DOmain might be added (sqlnet.ora)) the IP and Port of the remote DB have to match, as well as the Service or the SID ORACLE_HOME and sometimes some other ORA-Eniironments have to be set inside apache or PHP or by explicity call. mk -Ursprngliche Nachricht- Von: Randall Barber [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 12. Februar 2001 18:37 An: [EMAIL PROTECTED] Betreff: [PHP-DB] Oracle connectivity There was a post a few days ago here that indicated that PHP could only talk to Oracle databases if they resided on the same machine as the script because PHP could not deal with the TNS resolutions or something to that nature. I have an Oracle database that I need to connect to on another machine (I'll call it LIVE). The tnsnames.ora has the appropriate entry in it for TNS resolution to an IP connected database. I used Net8 to create the DSN mapping. When I use, OCILogon("TEST","web","pwd"); I get a TNS resolution error (which I was able to FINALLY overcome), and now I get "Could not connect to remote host." type error. I am running WinNT 4.0 w/IIS, PHP4. Now the reason I think its PHPs problem is because I can connect to the database using ASP and VBScript. I BELIEVE (not certain), that the client version I am running is 8.0.1.6. I am "assuming" (yikes) that the phpoci.dll is the one I needed, not the phporacle.dll. I have tried both and receive similar errors. Even using the ODBC component of PHP returns similar errors as above. Any suggestions are welcome. RDB -- 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]
AW: [PHP-DB] Oracle Persistant Connections
Yes, same question. The only thing i know about, is that, if you are running php not ass an module, your connection will die right ever script executing therefore making OCIPLogon = OCILogon. If run as module the connection will last till your server thread is regenerated. Therefore it can have a very dark side effect if the connections are not reliable reused: imagine 250 Apache Spawns with each hundreds of OCI-COnnections still open ... be carefull! And this is exactly my problem. I can not try tghis since the machine is running heavy traffic unless i know at leasst the theory Another Idea of reduicing Logon overhead is to run the server in MTS - Mode which does not cause the Oracle Server to start an dedicated ServerProcess for every Logon/Session. Well, suggestions please ;-) mk -Ursprngliche Nachricht- Von: Serge Paquin [mailto:[EMAIL PROTECTED]] I am using Oracle8i and want to make a little php script that will be run a huge amount of times (i hope g). PHP has the OCIPLogon for persistent connections and am wondering the details of how it works. I want the php script to run a simple insert then select statement and would like to avoid a huge logon penalty that comes with creating a new session to oracle since the life of the program is very short and the frequency very very high (again I hope). -- 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]
AW: [PHP-DB] Limit number of persistent oci8-connections?
Are you useing persistent connections (I had no real luck with them)? How do you connect to your DB over Multi Threaded Server (MTS) or Dedicated Server ? I think Oracles NET8 Config has a Parameter to limit this. Check out the MasterIndex at http://technet.oracle.com/doc/server.815/a68826/toc.htm mk -Ursprngliche Nachricht- Von: Karsten Dambekalns [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 25. Januar 2001 20:09 An: PHP Database Betreff: [PHP-DB] Limit number of persistent oci8-connections? Hi! I am using PHP to connect to an Oracle 8.1.5 database. Everything works fine, but the load on the oracle server is insanely high. So I would like to limit the number of connections. Is there something like the mysql max_persistent_connections statement? TIA, Karsten BTW: Has some used sqlrelay and would like to share the experience? -- Why do we have to hide from the police, daddy? Because we use emacs, son. They use vi. - mailto:[EMAIL PROTECTED] w: http://www.k-fish.de/ gpg: http://www.k-fish.de/mykeys.gpg -- 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-24324 in apache error log
For some strange reason I get an : Warning: failed to rollback outstanding transactions!: ORA-24324 : Service handle not initialised in ... on line 0 I'm running 4.0.3pl1 as server module with OCI8-support for apache 1.3.14 and had no problems with the same script under php3. After some error() calls and debugging I found it. If you got this error too check your script for double calls of ocilogogg. For some reason the second ocilogoff call is executed after the scripts output to the webserver has finished. Therefor the error message is placed only in the apache logfile and not on the page. cu
AW: [PHP-DB] MS-SQL Error Message Replacement
So you like to let the SQL check for those constraints and you want only the PHP to deal with that ugly error: - disable the error output by placing @ before your php-function - catch the error either by checking $php_errormsg (works only if error-tracking is enabled) or by the result code or mssql_get_last_message - find your keyword and print an adapted message I'm working with MS-SQL 7 and IIS 4 as well as PHP4.0.4 --- My question is that when a message is received while attempting to delete a row in [table x] while it is tied to [table y.column a] by a foreign key relationship [see below] Warning: MS SQL message: DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_COMPONENT_INDEX_page'. The conflict occurred in database 'corplan', table 'COMPONENT_INDEX', column 'pid'. (severity 16) in D: \Inetpub\wwwroot\admin\intranet.php on line 122 Warning: MS SQL: Query failed in D:\Inetpub\wwwroot\admin\intranet.php on line 122 How can I put in my own custom message when these errors occur? Should I be looking for a failed query message and then acting on that? I like the protection that the foreign key relationship enables, because you can't delete "parent" objects without removing the children first. I'm sure this really isn't a difficult question, I'm looking for for suggestions on how I should approach this. -- 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]
AW: [PHP-DB] PHP PopUp Window
This is not exactly a DB-Problem but: What I'm trying to do is after a user submits a form, PHP validates the form and if an error open a JavaScript popup window. I'm having trouble-getting PHP to either run the JavaScript or send the information to the browser so it can execute the JavaScript. Remember that PHP can't execute Javascripts !! it can only produce javascripts like $error = "No Name entered"; echo "scriptalert ('Your error is : $error !! ');/script"; Also on another note is it possible to hide the search portion of a URL that is sent using: ? header("Location: /index.php?hideme=yes"); ? I don't like the user seeing the sometimes-long URL that is sent using this manner. If you'd needn't the Redirect you could simply POST your formdata instead of GET. Since you stick on that Location:... try using a frameset around ;-) -- 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]