php-db Digest 26 Feb 2001 19:12:23 -0000 Issue 477 Topics (messages 6951 through 6963): Re: Server side or client side? 6951 by: Uioreanu Calin 6953 by: JJeffman Re: OCI 8 and rowid cause SIGSEGV 6952 by: Thies C. Arntzen Re: cookies, email and passwords 6954 by: JJeffman Re: Join causing Error? 6955 by: Johnny Withers Oracle 8i questions 6956 by: Chris Murtland 6958 by: Andreas Karajannis 6959 by: Joe Brown Re: Interbase + PHP 6957 by: Meir kriheli The dreaded 12154!! 6960 by: Kevin Porter 6962 by: Kevin Porter Updating a Grid of Data 6961 by: Chris Andrew Re: Can't connect to local MySQL server error 6963 by: Rick Emery Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Hello, I see here a problem in jsclient-side generated code. Suppose 1st list (category) has 100 elements and second list, the products (ex.) has each 200 elements. a code that prevents selecting in 1st list the category would select all 100 x 200 elements and use js to display the correct list. This is very expensive. The link solution seems much better Regards, Uioreanu Calin
That's what I've been telling to who asked about filling drop down lists at run time: When the amount of data is small you can generate JavaScript arrays to hold it otherwise you MUST reload the page to run your php script to fill up drop down lists. HTH. Jayme. -----Mensagem Original----- De: Uioreanu Calin <[EMAIL PROTECTED]> Para: <[EMAIL PROTECTED]> Enviada em: segunda-feira, 26 de fevereiro de 2001 06:54 Assunto: Re: [PHP-DB] Server side or client side? > Hello, > > I see here a problem in jsclient-side generated code. > Suppose 1st list (category) has 100 elements and second > list, the products (ex.) has each 200 elements. > > a code that prevents selecting in 1st list the category would > select all 100 x 200 elements and use js to display the correct > list. > > This is very expensive. The link solution seems much better > > Regards, > Uioreanu Calin > > > > -- > 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] >
On Sat, Feb 24, 2001 at 05:43:58PM +0100, Sven Voigt wrote: > On Friday 23 February 2001 17:03, you wrote: > > I suppose the authors never concieved a replacement parameter for select > > > > specification. > > > > try: > > > $sql =3D "select foo, bar, rid from masterdata WHERE rid=3D:rid" > > > > You need to loose the colon ":" or place it to the right of a where cla > > use. > > Sorry to bother this list again, but I don't get the point... :-( > > I need the rowid for later updates by a user form. So how can I issue a > select clause with 'WHERE rid=3D:rid'? Don't I need this for the *update* > clause??? rowids in 8i are an opaque data-type. so you need to convert them to something human-readable 1st (btw the column is called rowid and not rid). select ROWIDTOCHAR(rowid), name from test; ROWID NAME ------------------ -------------------------------- AAAGBFAAIAAAB/tAAA müller update test set name = 'hallo' where ROWID ='AAAGBFAAIAAAB/tAAA'; > > This is what I thought of: > 1.) select foo, bar, rid from masterdata > 2.) let user select data set to update with 'update.php?rowid=ROWID' > 3.) write changes to database: update foo, bar values (FOO, BAR) where > rowid=ROWID' usually one uses his/her self-defined primary key for that purpose. > > And what's about that colon? Is there any special meaning in PHP? no - in oracle sql the colon indicate that you are using a placeholder (= bind-variable); > > I'd highly appreciate your help/answer! Many thanks in advance BTW i cannot reproduce the reported crash - could you please try the latest snapshot from snaps.php.net and report if you still see this crash? thanx, tc
Have a look on PHP manual there is good information on mail functions, setcookie function, and other stuff. HTH Jayme. -----Mensagem Original----- De: Matthew Cothier <[EMAIL PROTECTED]> Para: <[EMAIL PROTECTED]> Enviada em: domingo, 25 de fevereiro de 2001 17:13 Assunto: [PHP-DB] cookies, email and passwords > Thanks! > > Is there anyone who can actually give me little bits of code that I need > cause I am in a rush with this........ > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maybe this will help: Break the query up into a variable so PHP can string it together better. Exec. the query, check the result, if good, check the results for rows, if results, display results, else, do nothing, if query faield, set err to 1 and set an error message. mysql_select_db("centraldb",$db); $qorder++; $query="SELECT q.questid, q.question, q.answer, q.qorder, q.depart, q.catid, " ."q.active, q.global, q.adate, q.author, q.authoremail, q.askemail, ."c.catid, c.category, c.under, c.corder, c.active " ." FROM central_groupfaqq q, central_groupfaqcat c " ."WHERE q.active = '1' AND q.global = '1' AND c.active = '1' " ."ORDER BY c.under, c.order, q.qorder;" ; if($result=mysql_query($query)) { if($num=mysql_num_ros($result)) { while ($myrow = mysql_fetch_row($result)) //display resutls } } else { //no results } } else { //bad query $err=1 $errMsg="Failed Query: $query<br>".mysql_errno()." : ".mysql_error(); } <---somehwere in html file----> if(!$err) { //display results and info here } else { printf("%s\n",$errMsg); } - --------------------- Johnny Withers [EMAIL PROTECTED] p. 601.853.0211 c. 601.954.9133 - -----Original Message----- From: Keith Spiller [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 25, 2001 2:30 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Join causing Error? Can anyone tell me why this: Line 282 mysql_select_db("centraldb",$db); Line 283 $qorder++; Line 284 $result = mysql_query("SELECT q.questid, q.question, q.answer, q.qorder, q.depart, q.catid, q.active, q.global, q.adate, q.author, q.authoremail, q.askemail, c.catid, c.category, c.under, c.corder, c.active FROM central_groupfaqq q, central_groupfaqcat c WHERE q.active = '1' AND q.global = '1' AND c.active = '1' ORDER BY c.under, c.order, q.qorder",$db); Line 285 while ($myrow = mysql_fetch_row($result)) Would cause this error: Warning: Supplied argument is not a valid MySQL result resource in faqbody.php3 on line 285 When changing the same SELECT statement to: Line 284 $result = mysql_query("SELECT * FROM central_groupfaqq WHERE active = '1' ORDER BY qorder",$db); Works perfectly? Keith Spiller a.k.a. Larentium -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com> iQA/AwUBOpppHLFNxPoD98ryEQL95QCffp7UNf0lJdx0lwSUjFdRKRths94AoIsS 4fpFCCXraXVYdkR2Hg5mKd0P =vlca -----END PGP SIGNATURE-----
I apologize for my cross-post, but since I received no response on the general list, I decided I must have posted in the wrong place. I am trying to update an Oracle 8i CLOB field. I have looked at previous messages on the list and am trying the following: $sql="update murtland.articles set title='$title',release_date=TO_DATE('$release_date','YYYY-MM-DD'),body=:body text,sections='$sections',mod_date=TO_DATE('$mod_date','yyyy-mm-dd hh24:mi:ss'),mod_userid=$userid where articleid=$articleid"; //echo $sql; $stmt=OCIParse($conn,$sql); $bodytext = OCINewDescriptor($conn, OCI_D_LOB); OCIBindByName($stmt,":bodytext",&$bodytext,-1,OCI_B_CLOB); OCIExecute($stmt, OCI_DEFAULT); $bodytext->save($body); OCICommit($stmt); $bodytext->free(); OCIFreeStatement($stmt); OCILogoff($conn); However, this gives me the error: invalid LOB locator specified. Also, does anyone have any example code for searching Oracle 8i CLOB fields? Do I have to create a stored procedure to be able to do this? I want to be able to search a separate varchar column in addition to searching the CLOB column. Thanks in advance, Chris ~~~~~~~~~~~~~~~~~~~~ Chris Murtland Studio Moxie, LLC www.studiomoxie.com 336.773.1684 800.707.2367 fax/voicemail
Chris Murtland wrote: > I am trying to update an Oracle 8i CLOB field. I have looked at > previous messages on the list and am trying the following: > $sql="update murtland.articles set title='$title',release_date=TO_DATE('$release_date','YYYY-MM-DD'),body=:body > text,sections='$sections',mod_date=TO_DATE('$mod_date','yyyy-mm-dd > hh24:mi:ss'),mod_userid=$userid where articleid=$articleid"; > //echo $sql; $stmt=OCIParse($conn,$sql); $bodytext = > OCINewDescriptor($conn, OCI_D_LOB); > OCIBindByName($stmt,":bodytext",&$bodytext,-1,OCI_B_CLOB); > OCIExecute($stmt, OCI_DEFAULT); $bodytext->save($body); OCICommit($stmt); > $bodytext->free(); OCIFreeStatement($stmt); > OCILogoff($conn); > Try the following SQL: "update ... , body = empty_clob(), ... returning body into :bodytext" > Also, does anyone have any example code for searching Oracle 8i CLOB > fields? Do I have to create a stored procedure to be able to do > this? I want to be able to search a separate varchar column in > addition to searching the CLOB column. > Try interMedia Text for searching B|CLOB columns. While stored procedures could be used, they will be painfully slow. -Andreas -- Andreas Karajannis mediaworx berlin AG Fon (0 30) 2 75 80 - 266 Fax (0 30) 2 75 80 - 200
":body" in sql isn't the same as ":bodytext" in the bindbyname statement, after that, you're in deeper than myself... HTH, -Joe ""Chris Murtland"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I apologize for my cross-post, but since I received no response on the > general list, I decided I must have posted in the wrong place. > > I am trying to update an Oracle 8i CLOB field. I have looked at previous > messages on the list and am trying the following: > > $sql="update murtland.articles set > title='$title',release_date=TO_DATE('$release_date','YYYY-MM-DD'),body=:body > text,sections='$sections',mod_date=TO_DATE('$mod_date','yyyy-mm-dd > hh24:mi:ss'),mod_userid=$userid where articleid=$articleid"; > //echo $sql; > $stmt=OCIParse($conn,$sql); > $bodytext = OCINewDescriptor($conn, OCI_D_LOB); > OCIBindByName($stmt,":bodytext",&$bodytext,-1,OCI_B_CLOB); > OCIExecute($stmt, OCI_DEFAULT); > $bodytext->save($body); > OCICommit($stmt); > $bodytext->free(); > OCIFreeStatement($stmt); > OCILogoff($conn); > > However, this gives me the error: invalid LOB locator specified. > > Also, does anyone have any example code for searching Oracle 8i CLOB fields? > Do I > have to create a stored procedure to be able to do this? > > I want to be able to search a separate varchar column in addition to > searching the CLOB column. > > Thanks in advance, > Chris > > ~~~~~~~~~~~~~~~~~~~~ > Chris Murtland > Studio Moxie, LLC > www.studiomoxie.com > 336.773.1684 > 800.707.2367 fax/voicemail > > > -- > 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] >
On Monday 26 February 2001 04:08, Duky wrote: > I am using a Unix/Linux server. How can I recompile my php to use > interbase?? Where can I find that, to recompile? what do I need to > recompile and what do I have to include into that file? I am new to > this. so if somebody can help me out.. really thanks. > > Duky If you're on linux you should configure php with --with-interbase=/path/to/your/interbase/install.dir and then compile it. -- Meir Kriheli There's someone in my head, but it's not me - Pink Floyd
Hi, We're moving a web site to new servers. We've recreated the DB and imported all the data from the old database. I've compiled a new Apache/PHP (1.3.9 / 4.0.1pl2). tnsnames.ora is set up correctly as far as we can tell, but I'm _still_ getting the dreaded 12154 error. We cannot see anything wrong. We've tried shutting down the web server, then the DB server and listener, then starting DB and listener, then starting Apache, but this has not worked. We have $ORACLE_HOME set, and we can log into the DB perfectly OK with sqlplus (as oracle8i user). Any ideas anyone? thanks in advance, - Kev -- http://www.megasoccer.com - Global Soccer http://www.fa-premier.com - English Premier League Football
's ok, we've sorted it now... we had installed the oracle s/w in oracle8i user's home directory - we had to set permissions of that to 755. Then, we found we hadn't installed the right language options on the client installations (web server box), so we're nearly there now. - Kev ""Kevin Porter"" <[EMAIL PROTECTED]> wrote in message 97e3e2$q4c$[EMAIL PROTECTED]">news:97e3e2$q4c$[EMAIL PROTECTED]... > Hi, > > We're moving a web site to new servers. We've recreated the DB and imported > all the data from the old > database. I've compiled a new Apache/PHP (1.3.9 / 4.0.1pl2). tnsnames.ora is > set up correctly as far as we > can tell, but I'm _still_ getting the dreaded 12154 error. > > We cannot see anything wrong. We've tried shutting down the web server, then > the DB server and listener, > then starting DB and listener, then starting Apache, but this has not > worked. > > We have $ORACLE_HOME set, and we can log into the DB perfectly OK with > sqlplus (as oracle8i user). > > Any ideas anyone? > > thanks in advance, > > - Kev > > > -- > http://www.megasoccer.com - Global Soccer > http://www.fa-premier.com - English Premier League Football > > > > -- > 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] >
My Setup: MySQL and PHP4. Two tables with one to many relationship: tblAccount (AccountId, AccountName, Comment) tblRates (RateId,GrossRate,AER,NetRate,AccountId(foreign key)). There are many rates per account. I need to provide a means for a user to loop through each element in tblRates updating as necessary. I suppose you could liken it to a spreadsheet, but clearly with limitations re: input boxes (names and values). I'm thinking along the lines of displaying a row at a time with a submit button - once clicked, an update query will run and the user will be presented with the next row. Seem ok - or would there be a better solution? Thanks for any input, Chris
I'm also having trouble connecting to the MySQL server. I can connect as root, but not as a user from the command line. When connect to the mysql server as ROOT, I've granted all privileges to the user using 'user@localhost' and 'user@"%" '. Still no luck. I'm using MySQL on Redhat Linux. I'm having same problem connecting via a mysql_connect(---) call in PHP. What do I need to do to allow user interaction for MySQL? thanks rick Richard L. Emery IT Sr. Project Manager "There is no 'trying'... There is only 'Do' or 'Not Do' " -----Original Message----- From: Brunner, Daniel [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 5:05 PM To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: RE: [PHP-DB] Can't connect to local MySQL server error Hello... Do a netstat -vatp To see if mysql is up and listening on your TCP. And it will give your PID/Program name as well... I remember reading something about if the mysql.sock didn't work...you needed to do something with mysql...I'll look into it this weekend..... If nobody can help you out sooner.... Well good luck... Dan > ---------- > From: Chris Weiss > Reply To: [EMAIL PROTECTED] > Sent: Friday, February 16, 2001 4:37 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Can't connect to local MySQL server error > > Help! > I'm experimenting with several of the PHP based WebDatabase front ends > and > am getting the following errors from all of them: > > "Warning: Can't connect to local MySQL server through socket > '/var/lib/mysql/mysql.sock' (111) in /home/httpd/html/pub/mainfile.php > on > line 9 > Unable to select database" > > I've tried the following: > [root@casadelove pub]# telnet localhost 3306 |strings > Trying 127.0.0.1... > Connected to casadelove.com. > Escape character is '^]'. > 3.23.27-beta > $Gu=m/>. > Connection closed by foreign host. > > The databases being requested do exist and are populated with the > default > data and WebMin (Perl-based web administration program) accesses the > test > databases just fine. > > This is on a RH6.2 system with Apache 1.3.14 and PHP 4.0.4. > > This strikes me as something really stupid that I'm missing, anyone > have any > bright ideas where to look? > > > -- > 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 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]