phplib-users Mailing List for PHPLIB (Page 87)
Brought to you by:
nhruby,
richardarcher
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(106) |
Sep
(99) |
Oct
(44) |
Nov
(97) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(56) |
Feb
(81) |
Mar
(134) |
Apr
(69) |
May
(106) |
Jun
(122) |
Jul
(98) |
Aug
(52) |
Sep
(184) |
Oct
(219) |
Nov
(102) |
Dec
(106) |
2003 |
Jan
(88) |
Feb
(37) |
Mar
(46) |
Apr
(51) |
May
(30) |
Jun
(17) |
Jul
(45) |
Aug
(19) |
Sep
(5) |
Oct
(4) |
Nov
(12) |
Dec
(7) |
2004 |
Jan
(11) |
Feb
(7) |
Mar
|
Apr
(15) |
May
(17) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
(8) |
Oct
(6) |
Nov
(21) |
Dec
(13) |
2005 |
Jan
(4) |
Feb
(3) |
Mar
(7) |
Apr
(7) |
May
|
Jun
(11) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2006 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(5) |
2007 |
Jan
(15) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
(3) |
Jul
(1) |
Aug
(19) |
Sep
(2) |
Oct
|
Nov
|
Dec
(6) |
2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
From: Eric M. <er...@pa...> - 2001-09-24 22:17:12
|
Peter Bowyer wrote: > > At 01:08 AM 9/24/01 -0500, you wrote: > >Just wondering how many of you out there have used PHP/PHPLIB with > >Oracle and whether you've had good experiences. I've been asked to > >evaluate the possibility of moving an application that is currently > >PHP/PHPLIB/Sybase to an Oracle backend, and if you have any gotchas to > >share, I would greatly appreciate the info. > > Just out of interest, why Oracle and not, for example, PostgreSQL, which is > being talked of as the open source alternative to Oracle? Not my choice -- the company I'm working for may mandate that I move the application to Oracle, and they definitely would not consider moving to an Open Source database, even though I'm using Apache/PHP for the Web frontend. Given the choice, I would explore Postgres as a possible alternative, but it is not one of my options. Eric |
From: Eric M. <er...@pa...> - 2001-09-24 22:13:22
|
Jesse Swensen wrote: > > I have used the oracle abstraction for a couple of years. I have found it > to complete enough to do our web site for several internal projects. I am > currently using it to support a global data warehouse for Nortel Networks. > > The only change I have thought would be nice would be to support commit and > rollback. Currently all transactions are auto committed. I have looked > into it and would be a minor thing to add. Actually, I extended db_sybase.inc to provide that functionality for Sybase for the application that I'm working on, but I never submitted it to the project because these features are not supported throughout DB_Sql and my code is kinda ugly right now. However, if anyone is interested, I'd be happy to contribute that work to db_sybase.inc. > > The shortcoming of the DB_SQL interface is it is based on MySQL. Don't get > me wrong, MySQL is a wonderful database and I have used it in several > projects. But it is not Oracle. There are many things that can be done > with the Oracle API that is not supported by DB_SQL. But most of them are > not of value in a web environment. So, selects, inserts, updates and > deletes are enough and DB_SQL has been bullet proof. > > I would recommend it. Thanks for the info. Eric |
From: Jesse S. <ph...@sw...> - 2001-09-24 18:04:49
|
Bind variables is one of the features that has not been address by DB_SQL. There is a quagmire of problems that need to be address by bind variables, i.e.; scalar(like you have implemented); two arrays in a matched set, one with variables the other the values; a hash of variable=>value or a function that loads the array. It becomes a challenge to address these issues. All of them are of some value, but unless you are using blobs, like in Mike's case, standard insert, update, delete, select works fine. > From: Mike Green <Mik...@sa...> > Organization: SaeSolved:: > Date: Mon, 24 Sep 2001 10:51:17 -0700 > To: er...@pa... > Cc: "php...@li..." <php...@li...> > Subject: Re: [Phplib-users] Oracle usage > > Eric, > > About a year ago I ran into a problem with Oracle and PHPLib. The patch > that I came up with after discussions with those on this list was posted > to the list on 12 October 2000. (I will paste the same post to the end of > this for your convenience.) Other than that I had no problems. > > The project then died when the firm for which I was doing the work > declared bankruptcy in January of 2001. This was after what I had > implemented had been well tested on a prototype basis, but before the web > site went into full production. I can't remark, therefore, on whether > there were any problems in the longer term or under high load conditions. > > The text of what I posted on 12 October 2000: > > "Well, with the suggestions here and those posted on the PHP manual pages > for OCI8 (especially those of jc...@id... on the page > http://www.php.net/manual/function.ocinewdescriptor.php), I've come up > with something that seems to be working. I thought it would be good to > post it here in case someone else can use it ...and to get your feedback. > > "I've extended the OCI8 DB_Sql class (db_oci8.inc,v 1.4 2000/07/12 > 18:22:34) by revising its function query to read: > > function query($Query_String, $bind_var = '', $bind_val = '') { > > /* No empty queries, please, since PHP4 chokes on them. */ > if ($Query_String == "") > /* The empty query string is passed on from the constructor, > * when calling the class without a query, e.g. in situations > * like these: '$db = new DB_Sql_Subclass;' > */ > return 0; > > $this->connect(); > > if ($bind_var){ > $clob = OCINewDescriptor($this->Link_ID, OCI_D_LOB); > $Query_String .= " returning $bind_var into :the_blob"; > } > > $this->Parse=OCIParse($this->Link_ID,$Query_String); > if(!$this->Parse) { > $this->Error=OCIError($this->Parse); > } else { > if ($bind_var) { > OCIBindByName($this->Parse, ':the_blob', &$clob, -1, > OCI_B_CLOB); > OCIExecute($this->Parse, OCI_DEFAULT); > if($clob->save($bind_val)){ > OCICommit($this->Link_ID); > }else{ > $this->Error = "Couldn't insert CLOB into database."; > } > OCIFreeDesc($clob); > } else { > OCIExecute($this->Parse); > } > $this->Error=OCIError($this->Parse); > } > > $this->Row=0; > > if($this->Debug) { > printf("Debug: query = %s<br>\n", $Query_String); > } > > if ($this->Error["code"]!=1403 && $this->Error["code"]!=0 && > $this->sqoe) > echo "<BR><FONT > color=red><B>".$this->Error["message"]."<BR>Query:\"$Query_String\"</B></FONT> > "; > > return $this->Parse; > } > > "This seems to be working. > > "It has three shortcomings that I am aware of: > > "1) It only allows for one type of 'bind' variable: CLOB. > > "2) It only allows for one column to be a 'bind' variable > > "3) One must be sure that the $Query_String is has the correct form for > this usage: '$bind_var' in $Query_String must be paired with > 'EMPTY_CLOB(),' not its value: $bind_val. > > "I can think of ways to deal with each of these, but not in the time I > have available to get the present project going. And this seems to be > doing the job for Inserts and Updates. > > "I find it a bit puzzling that Selects seem to work all right without > using this approach. I.e. I'm just using a straight SQL select, without > any 'binds.' And I seem to be having no trouble retrieving the data. ..." > > Cheers! > > Mike Green > > Eric McKeown wrote: > >> Hi folks, >> >> Just wondering how many of you out there have used PHP/PHPLIB with >> Oracle and whether you've had good experiences. I've been asked to >> evaluate the possibility of moving an application that is currently >> PHP/PHPLIB/Sybase to an Oracle backend, and if you have any gotchas to >> share, I would greatly appreciate the info. >> >> Thanks, >> >> Eric >> >> _______________________________________________ >> Phplib-users mailing list >> Php...@li... >> https://lists.sourceforge.net/lists/listinfo/phplib-users > > -- > Mike Green > SaeSolved:: > http://www.saesolved.com > http://www.everypeople.net > http://www.sitewidgets.com > http://www.widgetchuck.com > > > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Mike G. <Mik...@sa...> - 2001-09-24 14:53:09
|
Eric, About a year ago I ran into a problem with Oracle and PHPLib. The patch that I came up with after discussions with those on this list was posted to the list on 12 October 2000. (I will paste the same post to the end of this for your convenience.) Other than that I had no problems. The project then died when the firm for which I was doing the work declared bankruptcy in January of 2001. This was after what I had implemented had been well tested on a prototype basis, but before the web site went into full production. I can't remark, therefore, on whether there were any problems in the longer term or under high load conditions. The text of what I posted on 12 October 2000: "Well, with the suggestions here and those posted on the PHP manual pages for OCI8 (especially those of jc...@id... on the page http://www.php.net/manual/function.ocinewdescriptor.php), I've come up with something that seems to be working. I thought it would be good to post it here in case someone else can use it ...and to get your feedback. "I've extended the OCI8 DB_Sql class (db_oci8.inc,v 1.4 2000/07/12 18:22:34) by revising its function query to read: function query($Query_String, $bind_var = '', $bind_val = '') { /* No empty queries, please, since PHP4 chokes on them. */ if ($Query_String == "") /* The empty query string is passed on from the constructor, * when calling the class without a query, e.g. in situations * like these: '$db = new DB_Sql_Subclass;' */ return 0; $this->connect(); if ($bind_var){ $clob = OCINewDescriptor($this->Link_ID, OCI_D_LOB); $Query_String .= " returning $bind_var into :the_blob"; } $this->Parse=OCIParse($this->Link_ID,$Query_String); if(!$this->Parse) { $this->Error=OCIError($this->Parse); } else { if ($bind_var) { OCIBindByName($this->Parse, ':the_blob', &$clob, -1, OCI_B_CLOB); OCIExecute($this->Parse, OCI_DEFAULT); if($clob->save($bind_val)){ OCICommit($this->Link_ID); }else{ $this->Error = "Couldn't insert CLOB into database."; } OCIFreeDesc($clob); } else { OCIExecute($this->Parse); } $this->Error=OCIError($this->Parse); } $this->Row=0; if($this->Debug) { printf("Debug: query = %s<br>\n", $Query_String); } if ($this->Error["code"]!=1403 && $this->Error["code"]!=0 && $this->sqoe) echo "<BR><FONT color=red><B>".$this->Error["message"]."<BR>Query:\"$Query_String\"</B></FONT>"; return $this->Parse; } "This seems to be working. "It has three shortcomings that I am aware of: "1) It only allows for one type of 'bind' variable: CLOB. "2) It only allows for one column to be a 'bind' variable "3) One must be sure that the $Query_String is has the correct form for this usage: '$bind_var' in $Query_String must be paired with 'EMPTY_CLOB(),' not its value: $bind_val. "I can think of ways to deal with each of these, but not in the time I have available to get the present project going. And this seems to be doing the job for Inserts and Updates. "I find it a bit puzzling that Selects seem to work all right without using this approach. I.e. I'm just using a straight SQL select, without any 'binds.' And I seem to be having no trouble retrieving the data. ..." Cheers! Mike Green Eric McKeown wrote: > Hi folks, > > Just wondering how many of you out there have used PHP/PHPLIB with > Oracle and whether you've had good experiences. I've been asked to > evaluate the possibility of moving an application that is currently > PHP/PHPLIB/Sybase to an Oracle backend, and if you have any gotchas to > share, I would greatly appreciate the info. > > Thanks, > > Eric > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users -- Mike Green SaeSolved:: http://www.saesolved.com http://www.everypeople.net http://www.sitewidgets.com http://www.widgetchuck.com |
From: nathan r. h. <na...@ds...> - 2001-09-24 12:39:15
|
On Mon, 24 Sep 2001, Jesse Swensen wrote: > The only change I have thought would be nice would be to support commit and > rollback. Currently all transactions are auto committed. I have looked > into it and would be a minor thing to add. > Now that Sleepycay DB and INNO DB tables provide transaction abilites to MySQL I think the lack of commit / rollback will need to be addressed there as well. I haven't used them yet so I can't offer any good comments on them, their effectiviness, speed or anyhting, but they seem like a feature we'd want to support. -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: Peter B. <re...@f2...> - 2001-09-24 12:30:26
|
At 01:08 AM 9/24/01 -0500, you wrote: >Just wondering how many of you out there have used PHP/PHPLIB with >Oracle and whether you've had good experiences. I've been asked to >evaluate the possibility of moving an application that is currently >PHP/PHPLIB/Sybase to an Oracle backend, and if you have any gotchas to >share, I would greatly appreciate the info. Just out of interest, why Oracle and not, for example, PostgreSQL, which is being talked of as the open source alternative to Oracle? Thanks, Peter ---oOo--- Do you sendcard? http://www.sendcard.f2s.com/ PHP postcard script supporting 9 databases! ---oOo--- |
From: Jesse S. <ph...@sw...> - 2001-09-24 10:52:19
|
I have used the oracle abstraction for a couple of years. I have found it to complete enough to do our web site for several internal projects. I am currently using it to support a global data warehouse for Nortel Networks. The only change I have thought would be nice would be to support commit and rollback. Currently all transactions are auto committed. I have looked into it and would be a minor thing to add. The shortcoming of the DB_SQL interface is it is based on MySQL. Don't get me wrong, MySQL is a wonderful database and I have used it in several projects. But it is not Oracle. There are many things that can be done with the Oracle API that is not supported by DB_SQL. But most of them are not of value in a web environment. So, selects, inserts, updates and deletes are enough and DB_SQL has been bullet proof. I would recommend it. > From: Eric McKeown <er...@pa...> > Organization: Palaver > Reply-To: er...@pa... > Date: Mon, 24 Sep 2001 01:08:07 -0500 > To: "php...@li..." <php...@li...> > Subject: [Phplib-users] Oracle usage > > Hi folks, > > Just wondering how many of you out there have used PHP/PHPLIB with > Oracle and whether you've had good experiences. I've been asked to > evaluate the possibility of moving an application that is currently > PHP/PHPLIB/Sybase to an Oracle backend, and if you have any gotchas to > share, I would greatly appreciate the info. > > Thanks, > > Eric > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Richard A. <rh...@ju...> - 2001-09-24 07:04:21
|
At 1:08 AM -0500 24/9/01, Eric McKeown wrote: >Hi folks, > >Just wondering how many of you out there have used PHP/PHPLIB with >Oracle and whether you've had good experiences. I've been asked to >evaluate the possibility of moving an application that is currently >PHP/PHPLIB/Sybase to an Oracle backend, and if you have any gotchas to >share, I would greatly appreciate the info. The Oracle database abstraction class looks pretty dodgy to me. One of the trackers has a patch I compiled from various sources. But I can't test it because I don't run Oracle. I'd appreciate it if you (or anyone!) could apply the patch to a test installation of PHPLIB and give it a work-out. Once someone verifies that it works, I'll commit it to the CVS tree. ...Richard. |
From: Eric M. <er...@pa...> - 2001-09-24 06:08:16
|
Hi folks, Just wondering how many of you out there have used PHP/PHPLIB with Oracle and whether you've had good experiences. I've been asked to evaluate the possibility of moving an application that is currently PHP/PHPLIB/Sybase to an Oracle backend, and if you have any gotchas to share, I would greatly appreciate the info. Thanks, Eric |
From: Tero T. <ter...@ma...> - 2001-09-23 16:06:41
|
Date: Fri, 21 Sep 2001 17:37:28 +0300 From: Tero Tielinen <ter...@ma...> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1 X-Accept-Language: en-us To: ter...@ma... Subject: Array sort problem Hello! Firs of all, sorry about my bad english. I have a broblem, which i've tried to solve about two days now. I have an two-dimenssional array like this: $array[0]["id"] = 2; $array[1]["id"] = 3; $array[2]["id"] = 4; $array[3]["id"] = 5; $array[4]["id"] = 6; $array[5]["id"] = 7; $array[6]["id"] = 8; $array[7]["id"] = 9; $array[8]["id"] = 10; $array[0]["kat_id"] = 1; $array[1]["kat_id"] = 1; $array[2]["kat_id"] = 1; $array[3]["kat_id"] = 3; $array[4]["kat_id"] = 3; $array[5]["kat_id"] = 3; $array[6]["kat_id"] = 4; $array[7]["kat_id"] = 4; $array[8]["kat_id"] = 1; I want to sort the array by using the "id" and "kat_id" values. I've tried loop like this (among many others): for($i = 0; $i < sizeof($array); $i++) { $father = $array[$i]["id"]; for($j = $i; $j < sizeof($array); $j++) { if($father == $array[$j]["kat_id]) { return_array[] = $father; return_array[] = $array[$j][$id]; } else { return_array[] = $father; } } } The loop dont't work. And i now the broblem in theorrtical level. The loop should test does the latter value in if-part ($array[$j][$id]) have any child values, but i just can't get it to work. I want the result array, in this case, to look like this: $array[0]["kat_id"] = 1; $array[1]["kat_id"] = 1; $array[3]["kat_id"] = 3; $array[4]["kat_id"] = 3; $array[6]["kat_id"] = 4; $array[7]["kat_id"] = 4; $array[5]["kat_id"] = 3; $array[8]["kat_id"] = 1; Can anybody help me? Thanks, Tero |
From: nathan r. h. <na...@ds...> - 2001-09-20 20:18:30
|
On Thu, 20 Sep 2001, Stephen Woodbridge wrote: > Thanks. Yes, that is what I did do, but all the books I have say to use: > > while($row = mysql_fetch_array($result)) { > ... > } > > to fetch rows but this construct does not work reliably if (my guess is > if $row[0]=NULL) it can arbitrary fail based on the data set being > fetched. It is a hidden and silent failure based on data. this construct > is a poor one to tesch people to use as compared to something more ugly > but reliable like: > > $num = mysql_num_rows($result); > for ($i=0; $i<$num; $i++) { > $row = mysql_fetch_array($result); > ... > } > Well, it's reliable so long as you know your data doesn't contain any NULL vaules :) I think part of the issue is that your tables aren't normalized, or at least, you're not filling in default vaules. You can always rectifiy this by adding NOT NULL or by selecting a field that is garunteed to return data (like selecting the primary key as well, though shouldn't be too much of a speed hit, as it's well indexed) Whipping through the result set with a for() loop is certianly another way to go; however, as stated in the phplib manual, this doesn't work for all DB's as they may start returning data before the query is finished. It does work for MySQL though, and in this case, that's what counts. > Sorry, I'm just frustrated after spending 3.5 hours trying to track this > down when I was just trying a trivial experiment in my existing app. I > think I need to review all my existing code to see if this might be > happening elsewhere <sigh> > Understandable. It's always the little stuff that bugs me the most. -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: Stephen W. <wo...@me...> - 2001-09-20 17:28:54
|
Thanks. Yes, that is what I did do, but all the books I have say to use: while($row = mysql_fetch_array($result)) { ... } to fetch rows but this construct does not work reliably if (my guess is if $row[0]=NULL) it can arbitrary fail based on the data set being fetched. It is a hidden and silent failure based on data. this construct is a poor one to tesch people to use as compared to something more ugly but reliable like: $num = mysql_num_rows($result); for ($i=0; $i<$num; $i++) { $row = mysql_fetch_array($result); ... } Sorry, I'm just frustrated after spending 3.5 hours trying to track this down when I was just trying a trivial experiment in my existing app. I think I need to review all my existing code to see if this might be happening elsewhere <sigh> -Steve "nathan r. hruby" wrote: > > On Thu, 20 Sep 2001, Stephen Woodbridge wrote: > > > Bizzare, but true! > > > > Here is what I think the problem is. > > > > The column BIRT_PLAC may be NULL so the result set has a row with the > > value of NULL unless you use the WHERE clause. The problem is the that > > the > > > > while($row = mysql_fetch_array($result)) > > > > terminates the the while when it returns the NULL row result and the > > ORDER BY always place the NULL row result as the first row in the result > > set. Even more insidious would be an unsorted result that returns some > > row of data, then a NULL, then more rows of data. So you would get some > > rows, thnk things are great and not realize that you never processed the > > rest of the rows. Which is exactly what happens in my testing of this > > problem. > > > > This is VERY BAD! I use this type of construct ALL through my code. > > > > Any thoughts or comments? > > > > add NOT NULL to your WHERE clause > > > -Stephen Woodbridge > > > > Stephen Woodbridge wrote: > > > > > > Hi all, > > > > > > Sorry this is a little off topic, but I'm can't figure this one out and > > > someone here might have run into this problem. > > > > > > I have a SQL query to mysql from php3, the query has an optional WHERE > > > clause. I get results back if the where clause is included but none if > > > it is left out. > > > > > > select distinct BIRT_PLAC as PLACE from INDI where BIRT_PLAC like "%%" > > > order by PLACE > > > num=719 > > > > > > select distinct BIRT_PLAC as PLACE from INDI order by PLACE > > > num=0 > > > > > > BOTH queries work FINE if I cut and paste them into mysql directly. > > > Anyone have any ideas? > > > -Steve > > > > > > function Places($str) { > > > global $conn; > > > > > > $aPlaces = array(); > > > > > > $sql = "select distinct BIRT_PLAC as PLACE from INDI "; > > > if ($str != "") > > > $sql .= "where BIRT_PLAC like \"%$str%\" "; > > > $sql .= "order by PLACE "; > > > > > > print "<br>$sql<br>\n"; > > > $result = @mysql_query($sql, $conn) > > > or die("Can't execute query: $sql ! $php_errormsg"); > > > > > > $num = 0; > > > while ($row = mysql_fetch_array($result)) { > > > $aPlaces[] = $row["PLACE"]; > > > $num++; > > > } > > > print "num=$num<br>\n"; > > > } > > > > > > > _______________________________________________ > > Phplib-users mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phplib-users > > > > -- > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > nathan hruby / digital statement > na...@ds... > http://www.dstatement.com/ > > Public GPG key can be found at: > http://www.dstatement.com/nathan-gpg-key.txt > ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: nathan r. h. <na...@ds...> - 2001-09-20 17:13:56
|
On Thu, 20 Sep 2001, Stephen Woodbridge wrote: > Bizzare, but true! > > Here is what I think the problem is. > > The column BIRT_PLAC may be NULL so the result set has a row with the > value of NULL unless you use the WHERE clause. The problem is the that > the > > while($row = mysql_fetch_array($result)) > > terminates the the while when it returns the NULL row result and the > ORDER BY always place the NULL row result as the first row in the result > set. Even more insidious would be an unsorted result that returns some > row of data, then a NULL, then more rows of data. So you would get some > rows, thnk things are great and not realize that you never processed the > rest of the rows. Which is exactly what happens in my testing of this > problem. > > This is VERY BAD! I use this type of construct ALL through my code. > > Any thoughts or comments? > add NOT NULL to your WHERE clause > -Stephen Woodbridge > > Stephen Woodbridge wrote: > > > > Hi all, > > > > Sorry this is a little off topic, but I'm can't figure this one out and > > someone here might have run into this problem. > > > > I have a SQL query to mysql from php3, the query has an optional WHERE > > clause. I get results back if the where clause is included but none if > > it is left out. > > > > select distinct BIRT_PLAC as PLACE from INDI where BIRT_PLAC like "%%" > > order by PLACE > > num=719 > > > > select distinct BIRT_PLAC as PLACE from INDI order by PLACE > > num=0 > > > > BOTH queries work FINE if I cut and paste them into mysql directly. > > Anyone have any ideas? > > -Steve > > > > function Places($str) { > > global $conn; > > > > $aPlaces = array(); > > > > $sql = "select distinct BIRT_PLAC as PLACE from INDI "; > > if ($str != "") > > $sql .= "where BIRT_PLAC like \"%$str%\" "; > > $sql .= "order by PLACE "; > > > > print "<br>$sql<br>\n"; > > $result = @mysql_query($sql, $conn) > > or die("Can't execute query: $sql ! $php_errormsg"); > > > > $num = 0; > > while ($row = mysql_fetch_array($result)) { > > $aPlaces[] = $row["PLACE"]; > > $num++; > > } > > print "num=$num<br>\n"; > > } > > > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: Stephen W. <wo...@me...> - 2001-09-20 17:00:25
|
Bizzare, but true! Here is what I think the problem is. The column BIRT_PLAC may be NULL so the result set has a row with the value of NULL unless you use the WHERE clause. The problem is the that the while($row = mysql_fetch_array($result)) terminates the the while when it returns the NULL row result and the ORDER BY always place the NULL row result as the first row in the result set. Even more insidious would be an unsorted result that returns some row of data, then a NULL, then more rows of data. So you would get some rows, thnk things are great and not realize that you never processed the rest of the rows. Which is exactly what happens in my testing of this problem. This is VERY BAD! I use this type of construct ALL through my code. Any thoughts or comments? -Stephen Woodbridge Stephen Woodbridge wrote: > > Hi all, > > Sorry this is a little off topic, but I'm can't figure this one out and > someone here might have run into this problem. > > I have a SQL query to mysql from php3, the query has an optional WHERE > clause. I get results back if the where clause is included but none if > it is left out. > > select distinct BIRT_PLAC as PLACE from INDI where BIRT_PLAC like "%%" > order by PLACE > num=719 > > select distinct BIRT_PLAC as PLACE from INDI order by PLACE > num=0 > > BOTH queries work FINE if I cut and paste them into mysql directly. > Anyone have any ideas? > -Steve > > function Places($str) { > global $conn; > > $aPlaces = array(); > > $sql = "select distinct BIRT_PLAC as PLACE from INDI "; > if ($str != "") > $sql .= "where BIRT_PLAC like \"%$str%\" "; > $sql .= "order by PLACE "; > > print "<br>$sql<br>\n"; > $result = @mysql_query($sql, $conn) > or die("Can't execute query: $sql ! $php_errormsg"); > > $num = 0; > while ($row = mysql_fetch_array($result)) { > $aPlaces[] = $row["PLACE"]; > $num++; > } > print "num=$num<br>\n"; > } > |
From: Olivier D. <od...@ip...> - 2001-09-20 14:17:48
|
can you show us your while loop which is reading your database? Le Jeudi 20 Septembre 2001 15:54, Markus Hartwig a écrit : > template.tpl: > ------------------ > <tr> > <th><span style="text-decoration:underline">Datum</span></th> > <th><span style="text-decoration:underline">Status</span></th> > <th><span style="text-decoration:underline">Autor</span></th> > <th><span > style="text-decoration:underline">Versions-Nr.</span></th> > <th><span > style="text-decoration:underline">Checkout-Status</span></th> > <th><span style="text-decoration:underline">Funktionen</span></th> > </tr> > <!-- Begin AccessBlock --> > > <tr> > <td align="center">{Datum}</td> > <td align="center">{Status}</td> > <td align="center">{Autor}</td> > <td align="center">{Versions-Nr.}</td> > <td align="center">{Checkout-Status}</td> > <td align="center">{Buttons}</td> > </tr> > > <!-- End AccessBlock --> > </table> > ------------------------------------------------------------------- >--------- > ------------------------------------------------------------------- >--------- --------------------------- > script.php(template.inc is included): > -------------------------------------------------- > ........$t = new template(); > $t ->set_file("Out", "template.tpl"); > $t ->set_block("Out", "AccessBlock", "tBlock"); //The execution > of my php-script only works, if i rename my > > > "AccessBlock" in my set_block in "OUT". > > > .......$t ->set_var("Datum",$row['Date']); > $t ->set_var("Status",$row["Status"]); > $t ->set_var("Autor",$row["User_ID"]); > $t ->set_var("Versions-Nr.",$row["Version_ID"]); > $t ->set_var("Checkout-Status",$checkOutStatus); > > ......$t ->set_var("Buttons",$buttonString); > > $t->parse("tBlock", "AccessBlock", true); //Here i also > have to rename the "AccessBlock" "Out".-> And then i only get > > one row out of my database into my table. > . > > > ......$t-> pparse("Output","Out"); //This is the > final parse-order. > > > Is anybody in the position to help me by fixing my problem??? > ------------------------------------------------------------------- >--------- > ------------------------------------------------------------------- >--------- ------------------------------ > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users -- Responsable Système Information www.ipercast.net |
From: Stephen W. <wo...@me...> - 2001-09-20 14:12:05
|
Hi all, Sorry this is a little off topic, but I'm can't figure this one out and someone here might have run into this problem. I have a SQL query to mysql from php3, the query has an optional WHERE clause. I get results back if the where clause is included but none if it is left out. select distinct BIRT_PLAC as PLACE from INDI where BIRT_PLAC like "%%" order by PLACE num=719 select distinct BIRT_PLAC as PLACE from INDI order by PLACE num=0 BOTH queries work FINE if I cut and paste them into mysql directly. Anyone have any ideas? -Steve function Places($str) { global $conn; $aPlaces = array(); $sql = "select distinct BIRT_PLAC as PLACE from INDI "; if ($str != "") $sql .= "where BIRT_PLAC like \"%$str%\" "; $sql .= "order by PLACE "; print "<br>$sql<br>\n"; $result = @mysql_query($sql, $conn) or die("Can't execute query: $sql ! $php_errormsg"); $num = 0; while ($row = mysql_fetch_array($result)) { $aPlaces[] = $row["PLACE"]; $num++; } print "num=$num<br>\n"; } |
From: Markus H. <Mar...@Sy...> - 2001-09-20 13:55:00
|
template.tpl: ------------------ <tr> <th><span style="text-decoration:underline">Datum</span></th> <th><span style="text-decoration:underline">Status</span></th> <th><span style="text-decoration:underline">Autor</span></th> <th><span style="text-decoration:underline">Versions-Nr.</span></th> <th><span style="text-decoration:underline">Checkout-Status</span></th> <th><span style="text-decoration:underline">Funktionen</span></th> </tr> <!-- Begin AccessBlock --> <tr> <td align="center">{Datum}</td> <td align="center">{Status}</td> <td align="center">{Autor}</td> <td align="center">{Versions-Nr.}</td> <td align="center">{Checkout-Status}</td> <td align="center">{Buttons}</td> </tr> <!-- End AccessBlock --> </table> ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- --------------------------- script.php(template.inc is included): -------------------------------------------------- ........$t = new template(); $t ->set_file("Out", "template.tpl"); $t ->set_block("Out", "AccessBlock", "tBlock"); //The execution of my php-script only works, if i rename my "AccessBlock" in my set_block in "OUT". .......$t ->set_var("Datum",$row['Date']); $t ->set_var("Status",$row["Status"]); $t ->set_var("Autor",$row["User_ID"]); $t ->set_var("Versions-Nr.",$row["Version_ID"]); $t ->set_var("Checkout-Status",$checkOutStatus); ......$t ->set_var("Buttons",$buttonString); $t->parse("tBlock", "AccessBlock", true); //Here i also have to rename the "AccessBlock" "Out".-> And then i only get one row out of my database into my table. . ......$t-> pparse("Output","Out"); //This is the final parse-order. Is anybody in the position to help me by fixing my problem??? ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ------------------------------ |
From: darcy w. c. <da...@el...> - 2001-09-19 15:59:53
|
"nathan r. hruby" wrote: > > On Tue, 18 Sep 2001, darcy w. christ wrote: > > > has anyone done any work with SSL? i am specifically looking for a > > solution in which authentication through phplib would only occur over > > SSL. Since the login form is included through php, i'm not sure of the > > best way to force authentication over SSL. i've thought about inserting > > some redirects, but i wanted to ask everyone out first before i get > > bogged down in my own hack. i appreciate any tips. > > > > change the redirects in the auth.inc file to use https or simply change > your loginform() to do a check if the port is 443 and redirect if not. > You'll also need to make sure that the actual loginform POSTS's to a > secure URI. i guess my only option is to use a meta refresh because the page_open has already started the headers and so i cannot use a header("Location: ... ") function. Does that seem right? -- ~darcy w. christ Elegant Communications Inc. 416.362.9772 x222 | 416.362.8324 fax |
From: giancarlo p. <gia...@na...> - 2001-09-19 08:13:06
|
giancarlo pinerolo wrote: > > Anyway I think it is impossible to use Default_auth all over, without > Perm. The only way is to us an $auth->is_nobody() function, that basially checks if $auth->auth['uid']=="nobody"; So everywhere you can discern if he's actually logged or not. This is the only way of enforcing anything when default_auth is on and there's no Perm feature. -Gian > -------------------------------------------------- > QUICK REFERENCE on the possible combinations of > session, auth, default_auth, user and perms > -------------------------------------------------- > 1) session > access: > acessible by anyone > access levels: > none > data persistance > 'volatile' browser session persistance > typical usage > carry session data from page to page > > 2) session+auth+perm(opt) > access: > page for restricted access only, > access levels: > depending on the optional perms > data persistance: > volatile browser data persistance only > typical usage > protect access to the page, > optionally at different levels of restriction > > 3) session+default_auth+perm(mandatory) As I said, see before... > access: > page for both unrestricted and restricted access > restriction based on perms checks > access levels: > depend on mandatory perms > data persistance: > volatile browser data persistance only > typical usage > reuse the same page for both restricted and > unrestricted access, optionally at different > levels of restriction > conditional inclusion of content, > on a per-authentication-level basis > > > 4) session+auth+user+perm(opt) > access: > page for restricted access only, > access levels: > depend on optionl perms > data persistance: > volatile browser persistence > long-time persistence tied to user > typical usage > protected-only access to the page > optionally at different levels of restriction > own persistent data available for authenticated users > > 5) session+default_auth+user+perm(mandatory) > access: > page for both restricted and unrestricted access > restriction based on perms checks > access levels: > depend on perms checks > data persistance: > volatile browser persistence > long-time persistence tied to user > typical usage > reuse the same page for both restricted and > unrestricted access, based on perms, at different > levels of restriction > > conditional inclusion of content o a per-user basis > volatile session data available for unauthenticated > users > own persistent data available for authenticated users > > -------------------------------------------------------------------- > explanation: > > <<< access levels: > depending on the optional perms >>> > > the access to the page can be further restricted depending > on permission level (user, admin, author, etc) > > <<< conditional inclusion of content >> > > This means that the same page can show different components > and content to differeent classes of users > > <<< conditional inclusion of content, >>> > <<< on a per-authentication-level basis >>> > > in case 3) you only know 'who' is the visitor, if authenticated > or not, and optionally to what level > > <<< conditional inclusion of content o a per-user basis >>> > > in case 5) you can also provide the user with personalized content > pulled out from his persistent user storage > > ........................... > > James Wigdahl wrote: > > > > I believe I have found the source of the problem I am having... a bug > > in auth.inc > > > > I can't write just at the moment about it, but I will be doing a > > writeup (probably later this evening) and propose it as a patch to > > PHPlib... > > > > Thanks for your help... |
From: James W. <jwi...@ma...> - 2001-09-19 02:39:03
|
At 12:31 AM +0200 9/19/01, giancarlo pinerolo wrote: >Anyway I think it is impossible to use Default_auth all over, without >Perm. >with auth-with-nobody, Perm substitutes what Auth-without-nobody does. >With default_auth you are always authenticated (but at your site it >seems the contrary..) > >[snip] > >3) session+default_auth+perm(mandatory) > access: > page for both unrestricted and restricted access > restriction based on perms checks > access levels: > depend on mandatory perms > data persistance: > volatile browser data persistance only > typical usage > reuse the same page for both restricted and > unrestricted access, optionally at different > levels of restriction > conditional inclusion of content, > on a per-authentication-level basis > >[snip] session+default_auth+perm(opt) access: page for both unrestricted and restricted access restriction based on $auth->auth["uid"] == "nobody" for default_auth or on perms checks for authenticated users w/valid uid's if desired access levels: depend on whether user is nobody, authenticated with valid uid or optional perms beyond that data persistance: volatile browser data persistance only typical usage reuse the same page for both restricted and unrestricted access, optionally at different levels of restriction conditional inclusion of content, on a per-authentication-level basis I've got to get this project done... then I'll send my writeup and patch... unless asked for the short version before then... |
From: giancarlo p. <gia...@na...> - 2001-09-18 22:35:54
|
Anyway I think it is impossible to use Default_auth all over, without Perm. with auth-with-nobody, Perm substitutes what Auth-without-nobody does. With default_auth you are always authenticated (but at your site it seems the contrary..) here is an attempt of a quick ref on auth/user/perm -Gian ..... Subject: [phplib] attempt for a QUICK REF on auth, def_auth,user,perm Date: Thu, 19 Jul 2001 08:26:01 +0200 From: Giancarlo Pinerolo <gia...@na...> To: "ph...@li..." <ph...@li...> Unsurprisingly my box is down, but I managed for the mail to get through. So I wanted to have a final 'quick reference' for the various combinations of these features, and trying to explain their meaning in an easy to understand way. Can anyone 'in the deeps' of phplib give it a check? The viable, combinatons seems to be no more than five. Can you think of any other combinantion that makes any sense? Is there any other feature or setting of features that can produce other combos? (You know, I am working for the 'easy-phplib' project now...) -------------------------------------------------- QUICK REFERENCE on the possible combinations of session, auth, default_auth, user and perms -------------------------------------------------- 1) session access: acessible by anyone access levels: none data persistance 'volatile' browser session persistance typical usage carry session data from page to page 2) session+auth+perm(opt) access: page for restricted access only, access levels: depending on the optional perms data persistance: volatile browser data persistance only typical usage protect access to the page, optionally at different levels of restriction 3) session+default_auth+perm(mandatory) access: page for both unrestricted and restricted access restriction based on perms checks access levels: depend on mandatory perms data persistance: volatile browser data persistance only typical usage reuse the same page for both restricted and unrestricted access, optionally at different levels of restriction conditional inclusion of content, on a per-authentication-level basis 4) session+auth+user+perm(opt) access: page for restricted access only, access levels: depend on optionl perms data persistance: volatile browser persistence long-time persistence tied to user typical usage protected-only access to the page optionally at different levels of restriction own persistent data available for authenticated users 5) session+default_auth+user+perm(mandatory) access: page for both restricted and unrestricted access restriction based on perms checks access levels: depend on perms checks data persistance: volatile browser persistence long-time persistence tied to user typical usage reuse the same page for both restricted and unrestricted access, based on perms, at different levels of restriction conditional inclusion of content o a per-user basis volatile session data available for unauthenticated users own persistent data available for authenticated users -------------------------------------------------------------------- explanation: <<< access levels: depending on the optional perms >>> the access to the page can be further restricted depending on permission level (user, admin, author, etc) <<< conditional inclusion of content >> This means that the same page can show different components and content to differeent classes of users <<< conditional inclusion of content, >>> <<< on a per-authentication-level basis >>> in case 3) you only know 'who' is the visitor, if authenticated or not, and optionally to what level <<< conditional inclusion of content o a per-user basis >>> in case 5) you can also provide the user with personalized content pulled out from his persistent user storage ........................... James Wigdahl wrote: > > I believe I have found the source of the problem I am having... a bug > in auth.inc > > I can't write just at the moment about it, but I will be doing a > writeup (probably later this evening) and propose it as a patch to > PHPlib... > > Thanks for your help... |
From: nathan r. h. <na...@ds...> - 2001-09-18 22:12:22
|
On Tue, 18 Sep 2001, darcy w. christ wrote: > has anyone done any work with SSL? i am specifically looking for a > solution in which authentication through phplib would only occur over > SSL. Since the login form is included through php, i'm not sure of the > best way to force authentication over SSL. i've thought about inserting > some redirects, but i wanted to ask everyone out first before i get > bogged down in my own hack. i appreciate any tips. > change the redirects in the auth.inc file to use https or simply change your loginform() to do a check if the port is 443 and redirect if not. You'll also need to make sure that the actual loginform POSTS's to a secure URI. > by the way, i couldn't get to the documentation at sourceforge. What > happened to it? > It died. we're working on it. -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: darcy w. c. <da...@el...> - 2001-09-18 22:06:14
|
has anyone done any work with SSL? i am specifically looking for a solution in which authentication through phplib would only occur over SSL. Since the login form is included through php, i'm not sure of the best way to force authentication over SSL. i've thought about inserting some redirects, but i wanted to ask everyone out first before i get bogged down in my own hack. i appreciate any tips. by the way, i couldn't get to the documentation at sourceforge. What happened to it? -- ~darcy w. christ Elegant Communications Inc. 416.362.9772 x222 | 416.362.8324 fax |
From: Truman L. <tr...@ha...> - 2001-09-18 17:33:15
|
I only started learning PHP and MySQL in the summer of 2000. But God blessed me with freelance jobs within six months. Much of my contacts came by building a relationship with a small Flash design company who needed someone to help them with database driven sections of sites they were hired to do. They continue to ask me to do projects. I got to know them because they go to my church. Also my church hired me to do a fairly large membership database application which I did in phplib. This gave me consistent work since December. Now the pastor wants to have the entire thing reprogrammed in ASP because he's afraid that if something happens to me, no one will be able to modify the application or make new reports. There are a bunch of ASP companies in town, but no PHP companies. Are there any PHP programmers in Hawaii out there? If there are any reliable US-based PHP companies that can service this application perhaps I can persuade my pastor not to port the application. If you're interested, please email me. By the way, I just turned down a 20 hr/wk maintenance job for the Chaminade University site programmed in PHP. www.chaminade.edu That might be a lead for somebody. I also got other jobs because of professional contacts in the community through my previous life before PHP. For me personal and professional contacts have really paid off, so I haven't done pursued any other means of getting work. All the best to you, Nathan. ----- Original Message ----- From: "nathan r. hruby" <na...@ds...> To: <php...@li...> Sent: Monday, September 17, 2001 8:43 AM Subject: [Phplib-users] [OT] Freelance Question / Guidance > > Ok.. > > I hate my job. It makes me miserable. This has been so for a while but > has gotten to the point that I need to sneak off to the server room to > write an email. Oh wait.. Sorry almost went a'ranting.. > > So my question to you, the best folks of the php world, is how many of you > are making a living as freelance php coders? Is it possible to make a > living doing this or am I setting my self up for eviction? In the past > I've gotten the odd offer for freelance work associated with phpSlash, > which I've always been too busy to take, but I'm pretty sure that phpSlash > wouldn't pay the bills -- is there other stuff out there, espically in the > post-dot-bomb? If you are making it, what stratigies have worked for you? > Where have you picked up work? (things posted online, mailing lists, > word-of-mouth?) > > I can run a mean linux system too, but linux geeks are a dime a dozen in a > university town. > > Insight, opinions, flames, job offers and anything else welcome. > > -n > > -- > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > nathan hruby / digital statement > na...@ds... > http://www.dstatement.com/ > > Public GPG key can be found at: > http://www.dstatement.com/nathan-gpg-key.txt > ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > > > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Tarique S. <ta...@sa...> - 2001-09-18 14:08:20
|
On Mon, 17 Sep 2001, nathan r. hruby wrote: Hello Nathan, Please don't feel dejected - these are bad times ... ... > So my question to you, the best folks of the php world, is how many of you > are making a living as freelance php coders? Is it possible to make a Yes it is possible - I started out more than 2 years ago as a single person, one computer in the bedroom corner doing PHP. Today I employ 7 people ( 5 are programmers), have a full fledged though very sparsely furnished office - and we do nothing but *PHP* The first half of last year was damn good BUT we did not get any work from Nov2000 to end April2001 - we exhausted our reserves but we survived - I did not lay off any of my boys, they are hand picked and trained by my humble self. Since April we have had a steady trickle of jobs which were meeting our overheads - however in past couple of months we have bagged projects which if completed and *paid* for will put us in firmly in black. So how was this possible... ... A large thanks goes out to my wife (who deservedly is the CEO) She meticulously applied to every freelance site replied to the dumbest queries by clients and offered 10 hours of work on no obligation basis!!! For almost 6 months all she use to do was follow even the smallest project, being online on a dial-up 5-7 hours at a stretch... ... She has a long list of these e-lance sites - mail to her at sw...@sa... if you want the URLs Plus - I wrote a lot, for magazines, sites, attended conferences, gave free PHP tutions at the local LUG, created GPLed software sent press guys the URLs to free stuff - all this she said was a PR excercise So as she says - "You have to keep at it!!" Cheers Tarique P.S. get married if you are not already ;-) -- ========================================================== PHP Applications for E-Biz : http://www.sanisoft.com The Ultimate Ghazal Lexicon: http://www.aaina-e-ghazal.com ========================================================== |