You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
(103) |
Apr
(37) |
May
(45) |
Jun
(49) |
Jul
(55) |
Aug
(11) |
Sep
(47) |
Oct
(55) |
Nov
(47) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(43) |
Feb
(85) |
Mar
(121) |
Apr
(37) |
May
(33) |
Jun
(33) |
Jul
(14) |
Aug
(34) |
Sep
(58) |
Oct
(68) |
Nov
(31) |
Dec
(9) |
2004 |
Jan
(13) |
Feb
(57) |
Mar
(37) |
Apr
(26) |
May
(57) |
Jun
(14) |
Jul
(8) |
Aug
(12) |
Sep
(32) |
Oct
(10) |
Nov
(7) |
Dec
(12) |
2005 |
Jan
(8) |
Feb
(25) |
Mar
(50) |
Apr
(20) |
May
(32) |
Jun
(20) |
Jul
(83) |
Aug
(25) |
Sep
(17) |
Oct
(14) |
Nov
(32) |
Dec
(27) |
2006 |
Jan
(24) |
Feb
(15) |
Mar
(46) |
Apr
(5) |
May
(6) |
Jun
(9) |
Jul
(12) |
Aug
(5) |
Sep
(7) |
Oct
(7) |
Nov
(4) |
Dec
(5) |
2007 |
Jan
(4) |
Feb
(1) |
Mar
(7) |
Apr
(3) |
May
(4) |
Jun
|
Jul
|
Aug
(2) |
Sep
(2) |
Oct
|
Nov
(22) |
Dec
(19) |
2008 |
Jan
(94) |
Feb
(19) |
Mar
(32) |
Apr
(46) |
May
(20) |
Jun
(10) |
Jul
(11) |
Aug
(20) |
Sep
(16) |
Oct
(12) |
Nov
(13) |
Dec
|
2009 |
Jan
|
Feb
(9) |
Mar
(37) |
Apr
(65) |
May
(15) |
Jun
|
Jul
(24) |
Aug
(1) |
Sep
(8) |
Oct
(4) |
Nov
(21) |
Dec
(5) |
2010 |
Jan
(35) |
Feb
(6) |
Mar
(8) |
Apr
|
May
(4) |
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: SourceForge.net <no...@so...> - 2004-01-15 16:48:50
|
Bugs item #877667, was opened at 2004-01-15 08:48 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=877667&group_id=8956 Category: SQL Group: v1.6.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: minor error in db script? 1.6.1 Initial Comment: A type seems to led to handling choice 7 as a comment, so that value doesn't get inserted into the table INSERT INTO question_type VALUES ('6','Dropdown Box','Y','response_single'); -- # INSERT INTO question_type VALUES ('7','Rating','N','response_rank'); INSERT INTO question_type VALUES ('8','Rate (scale 1..5)','Y','response_rank'); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=877667&group_id=8956 |
From: SourceForge.net <no...@so...> - 2004-01-15 10:23:21
|
Feature Requests item #877461, was opened at 2004-01-15 02:23 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=358956&aid=877461&group_id=8956 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: View a Respondents submitted response in the Survey? Initial Comment: Is there any way to view the repondents response in the survey, even though its already been submitted. I understand we can see the results in the management menu, but if we could POST the variables; sid, responseid, username. And this would return us the survey with all the response details in. Cheers Alf Ale...@ho... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=358956&aid=877461&group_id=8956 |
From: SourceForge.net <no...@so...> - 2004-01-15 00:43:50
|
Feature Requests item #877028, was opened at 2004-01-14 13:33 Message generated for change (Comment added) made by jimmerman You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=358956&aid=877028&group_id=8956 Category: survey format Group: None >Status: Pending Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Sub Questions Initial Comment: I have a user request to be able to have a multi-part question such as the one below Q: Please select the extent to which each of the following contributed to your knowledge and skill in Quality Improvement in healthcare. 1. Not at all 2. Somewhat 3. Very much Sub-Part: A. Practical experience 1 2 3 B. Formal education 1 2 3 C. Self-study 1 2 3 D. Research 1 2 3 E. Other ________ please specify 1 2 3 ---------------------------------------------------------------------- >Comment By: James Flemer (jimmerman) Date: 2004-01-14 19:43 Message: Logged In: YES user_id=39444 The "Rate (1..5)" type covers most of this. Just set "Length" to 3. The only thing not available is "Other ..." support for this question type. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=358956&aid=877028&group_id=8956 |
From: SourceForge.net <no...@so...> - 2004-01-14 18:33:54
|
Feature Requests item #877028, was opened at 2004-01-14 10:33 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=358956&aid=877028&group_id=8956 Category: survey format Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Sub Questions Initial Comment: I have a user request to be able to have a multi-part question such as the one below Q: Please select the extent to which each of the following contributed to your knowledge and skill in Quality Improvement in healthcare. 1. Not at all 2. Somewhat 3. Very much Sub-Part: A. Practical experience 1 2 3 B. Formal education 1 2 3 C. Self-study 1 2 3 D. Research 1 2 3 E. Other ________ please specify 1 2 3 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=358956&aid=877028&group_id=8956 |
From: - 2004-01-11 05:14:24
|
-------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- (This safeguard is not inserted when using the registered version) -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- (This safeguard is not inserted when using the registered version) -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- |
From: Matt C. <ma...@op...> - 2003-12-23 22:51:42
|
Two minor suggestions for 'section text' questions: even if the administrator has set the question as 'required' phpESP should never tell a user that they need to fill out that question before proceeding (I just did this by accident.) Also, it doesn't really make sense to show this text in the survey results page. Otherwise, I'm happy with this package. Thanks to all the maintainers for their work! Cheers, Matt -- Openflows Networks Ltd. New York | Toronto | Waterloo | Vienna http://openflows.org People are intelligent. Machines are tools. |
From: Matthew G. <gr...@mu...> - 2003-12-23 14:46:51
|
This value should be set when from a "basic auth" see attached for an untested example. On Sat, 2003-12-20 at 12:27, Charlie Smith wrote: > I noticed that $HTTP_SERVER_VARS['PHP_AUTH_PW'] sometimes is visible > and at other times is not. What are the steps you use in the phpESP > to make this item visible? Does it have something to do with > registering the session? I'm trying to reproduce this value outside > of phpESP - ie. using another php program. > > ------------------------------------------------------------------------------ > This message may contain confidential information, and is intended > only for the use of the individual(s) to whom it is addressed. > > > ============================================================================== -- mcg ------------------------------------- The IT Lab (http://www.itlab.musc.edu) |
From: Charlie S. <sm...@ld...> - 2003-12-20 17:27:44
|
I noticed that $HTTP_SERVER_VARS['PHP_AUTH_PW'] sometimes is visible and at= = other times is not. What are the steps you use in the phpESP to make this = item visible? Does it have something to do with registering the session? = = I'm trying to reproduce this value outside of phpESP - ie. using another ph= p= program. ---------------------------------------------------------------------------= --- This message may contain confidential information, and is intended only for= = the use of the individual(s) to whom it is addressed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D |
From: Dan J L. <dan...@an...> - 2003-12-12 04:52:07
|
UNSUBSCRIBE -- On Wed, 03 Dec 2003 19:48:12 Maria Rossier wrote: >Hi all, > >For some of my surveys I need a forking utility. On the user-archive I read >that forking is not part of the official phpESP. I also found several >patches but it seems that all those patches are build for old phpESP >versions. I am using the latest CVS version - a lot of files from this >version are totally different from the old phpESP-versions. > >My question: has anyone a forking patch available build on the latest CVS >version - and if so - is there a possibility that I could make use of this >version ? > >Thanks a lot, > >Maria Rossier > >_________________________________________________________________ >MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >Does SourceForge.net help you be more productive? Does it >help you create better code? SHARE THE LOVE, and help us help >YOU! Click Here: http://sourceforge.net/donate/ >_______________________________________________ >phpESP-devel mailing list >php...@li... >https://lists.sourceforge.net/lists/listinfo/phpesp-devel > ____________________________________________________________ Get 25MB of email storage with Lycos Mail Plus! Sign up today -- http://www.mail.lycos.com/brandPage.shtml?pageId=plus |
From: James E. F. <jf...@uv...> - 2003-12-11 23:54:17
|
Paul R. Jackson wrote: > I'm wondering if anybody else has timeout problems when downloading the data > from phpESP. > > Our server is certainly no super computer (read: PII 350mhz) and I realise > that this is what causes the problem really but given our surveys are > relatively small (500+ responses, 100+ questions) I think everybody will hit > this problem sooner or later if their surveys get large enough. > > Initially it was the php max-execution-time that was breaking it but I > increased that significantly and now it's the i.e. connection timeout. This > too can be increased and/or you can use mozilla which seems to have a longer > timeout. > > The main problem for me is that it falls over in a very graceful manner and > users don't know what the hell is happening. > > We will be upgrading or server in the near future so the problem for me will > probably evaporate but I am interested to see if other people are > experiencing the same issue from time to time. > > Paul Paul, One way to speed up phpESP is to add indicies to the mysql tables. By using an index lookup rather than a search, mysql can process queries faster. I believe there was some discussion of this in the past on the list, perhaps the poster could re-post a summary. -James (BTW, the list address is phpesp-devel@... the phpesp-devel-admin@... mail just goes to me.) |
From: Richard P. <pa...@un...> - 2003-12-11 01:14:55
|
File difference report generated by CSDiff by ComponentSoftware on 11/12/2003 11:31 AM Base file: C:\Inetpub\wwwroot\pspesp-base\scripts\db\mysql_populate.sql Compared file: C:\Inetpub\wwwroot\phpesp\scripts\db\mysql_populate.sql 232a233,234 > INSERT INTO question_type VALUES ('25','URL','N','response_text'); > INSERT INTO question_type VALUES ('26,'HTTP','N','response_text'); <--------------------- End of report ---------------------> |
From: Maria R. <mar...@ho...> - 2003-12-09 19:31:43
|
Hi All, For my surveys I need the forking (skipping) utility. On the userlist I read that forking is not an official phpESP functionality. I also read that there are some patches available. I tried to insert these patches in my version (1.6.1 based on the latest CVS) but all the available patches are build for old phpESP-versions. Several files of the 1.6.1 -version are completely different from the older versions. My question: has anyone a production stable forking-patch available for the latest phpESP CVS-version. If so, is there a possibility for me to use that patch? Thanks a lot for your reaction. Maria Rossier _________________________________________________________________ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl |
From: Maria R. <mar...@ho...> - 2003-12-03 19:48:19
|
Hi all, For some of my surveys I need a forking utility. On the user-archive I read that forking is not part of the official phpESP. I also found several patches but it seems that all those patches are build for old phpESP versions. I am using the latest CVS version - a lot of files from this version are totally different from the old phpESP-versions. My question: has anyone a forking patch available build on the latest CVS version - and if so - is there a possibility that I could make use of this version ? Thanks a lot, Maria Rossier _________________________________________________________________ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl |
From: Maria R. <mar...@ho...> - 2003-12-02 20:28:55
|
Hi all, For my survey I need the forking utility. I read that forking is not a part of phpESP. I found some forking patches but they seem to be build for older phpESP versions. I am using the latest CVS version of phpESP - several files are completely different from older versions. My question: has anyone a forking patch available build on the latest phpESP CVS version, and if so - is there a possibility that I could use it? Thanks a lot. Maria Rossier _________________________________________________________________ Spel spelletjes met je online vrienden via MSN Messenger http://messenger.msn.nl/ |
From: Kon <ang...@ip...> - 2003-11-26 01:02:17
|
Johan, Prior to playing around with the phpESP dataabase make sure you create a backup of the database. as for disabling the enter key you can use javascript to do it but remember that it will only work on browsers that have javascript enabled and those that understand the onkeypress event. Having said that here's a simple way of doing it. function disableKeys(e){ var Key = document.all?window.event.keyCode:e.which; return Key != 13; } document.onkeypress = disableKeys; if (document.layers) document.captureEvents(Event.KEYPRESS); entering this code into the manage.php file (within the head tags) will disable the enter key on every page that uses this file (which is almost all of them). Be warned that this too has implication. When entering text into a textarea for example you will no longer be able to use the enter key to create new lines. Regards Kon On Wed, 2003-11-26 at 03:02, Johan Geertsma wrote: > Hi, > > Can someone tell me how to remove the results from 1 respondent? > > I now did it to set the COMPLETE to N. But I want to remove all the stuff > that this person submitted. I know how to find out which id he.she has. > > > Why? > Well that is my next question. How can I disable the enter key? > When people start a survey and hit enter, the form is submitted. > (yeah I could use the option that all answers are required). But you > guess it, the survey is not jet complete. > > I searched around for something to disable the enter key, but I see that > there is > a little javascript that does something before sending. > > anyone? > > Thanks, > Johan > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel |
From: Brian W. <br...@uc...> - 2003-11-25 22:41:10
|
resending to list. >Date: Tue, 25 Nov 2003 10:12:22 -0800 >To: Johan Geertsma <Joh...@co...> >From: Brian Wood <br...@uc...> >Subject: Re: [phpesp-dev] remove respndents results. > >At 05:02 PM 11/25/2003 +0100, you wrote: >>Hi, >> >>Can someone tell me how to remove the results from 1 respondent? >> >>I now did it to set the COMPLETE to N. But I want to remove all the stuff >>that this person submitted. I know how to find out which id he.she has. > >Setting response.complete = N means that the person has not completed the >survey. If this is a private survey (requiring the respondent to login) >you might be limiting the number of responses to 1. In this case the N >setting will allow this person to take the survey again. Probably you >know that... > >To remove a response: > >(Take care at the mysql console, you can do great harm with an unqualified >'delete' or 'update'!!!) > ><pre> >select * from response where username = 'joeblow' and survey_id =9 >+----+-----------+----------------+----------+----------------------------------+ >| id | survey_id | submitted | complete | >username | >+----+-----------+----------------+----------+----------------------------------+ >| $rid | 9 | 20031008132225 | Y | joeblow | >+----+-----------+----------------+----------+----------------------------------+ >1 row in set (0.03 sec) > >Make sure this is the right row! Then: > >delete from response where username = 'joeblow'; > >Substitute the correct value for $id > >select * from response_text where response_id = $id; > >Make SURE the responses you see here are the ones you want to remove! > >delete from response_text where response_id = $id; > >Do the analogous deletes for the remaining response tables: > >show tables like 'response%'; >+------------------------------------+ >| Tables_in_phpesp_devel (response%) | >+------------------------------------+ >| response | >| response_bool | >| response_date | >| response_multiple | >| response_other | >| response_rank | >| response_single | >| response_text | >+------------------------------------+ >8 rows in set (0.00 sec) > ></pre> > > >You'll probably want to avoid going through all this in the future! > >Brian Wood >Programmer/Analyst >UC Berkeley Human Resources > > > > > >>Why? >>Well that is my next question. How can I disable the enter key? >>When people start a survey and hit enter, the form is submitted. >>(yeah I could use the option that all answers are required). But you >>guess it, the survey is not jet complete. >> >>I searched around for something to disable the enter key, but I see that >>there is >>a little javascript that does something before sending. >> >>anyone? >> >>Thanks, >>Johan >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: SF.net Giveback Program. >>Does SourceForge.net help you be more productive? Does it >>help you create better code? SHARE THE LOVE, and help us help >>YOU! Click Here: http://sourceforge.net/donate/ >>_______________________________________________ >>phpESP-devel mailing list >>php...@li... >>https://lists.sourceforge.net/lists/listinfo/phpesp-devel > >Brian Wood >Programmer/Analyst >UC Berkeley Human Resources |
From: Brian W. <br...@uc...> - 2003-11-25 18:52:50
|
At 05:02 PM 11/25/2003 +0100, Johan Geertsma wrote: >Hi, > >Can someone tell me how to remove the results from 1 respondent? > >I now did it to set the COMPLETE to N. But I want to remove all the stuff >that this person submitted. I know how to find out which id he.she has. > > >Why? >Well that is my next question. How can I disable the enter key? >When people start a survey and hit enter, the form is submitted. >(yeah I could use the option that all answers are required). But you >guess it, the survey is not jet complete. > >I searched around for something to disable the enter key, but I see that >there is >a little javascript that does something before sending. Yeah I needed to disable that too since I am limiting responses to one. It's easy for a user to hit Enter and lock themselves out of a partially completed survey. I was trying to generate a nice diff for you, but I must have changed some formatting in this file. Below is handler.php which I'm pretty sure is the only file I needed to modify. Someone else may have more elegant way of doing this, but this has been working well for me: Line 83: if(!empty($HTTP_POST_VARS['submit']) || (isset($HTTP_POST_VARS['alt_submit']) && $HTTP_POST_VARS['alt_submit'] == 'Submit Survey')) { Line 194: <!-- prevent form from being submitted by enter key. --> <!-- input type="submit" name="submit" value="Submit Survey" --> <input type="hidden" name="alt_submit" value="Submit Survey"> <input type="button" value="Submit Survey" onClick="this.form.submit()"> Complete file below. Brian Wood Programmer/Analyst UC Berkeley Human Resources <pre> <?php # $Id: handler.php,v 1.24.2.1 2003/04/23 00:05:22 jimmerman Exp $ // Written by James Flemer // For eGrad2000.com // <jf...@al...> /* When using the authentication for responses you need to include * part of the script *before* your template so that the * HTTP Auth headers can be sent when needed. * * See the handler-prefix.php file for details. */ if (!defined('ESP_BASE')) define('ESP_BASE', dirname(dirname(__FILE__)) .'/'); require_once(ESP_BASE . '/admin/phpESP.ini.php'); require_once($ESPCONFIG['include_path']."/funcs".$ESPCONFIG['extension']); require_once($ESPCONFIG['handler_prefix']); if(!defined('ESP-AUTH-OK')) { if (!empty($GLOBALS['errmsg'])) echo($GLOBALS['errmsg']); return; } esp_init_db(); if (empty($HTTP_POST_VARS['referer'])) $HTTP_POST_VARS['referer'] = ''; // show results instead of show survey // but do not allow getting results from URL or FORM if(isset($results) && $results) { // small security issue here, anyone could pick a QID to crossanalyze survey_results($sid,$precision,$totals,$qid,$cids); return; } // else draw the survey $sql = "SELECT status, name FROM survey WHERE id='${sid}'"; $result = mysql_query($sql); if ($result && mysql_num_rows($result) > 0) list ($status, $name) = mysql_fetch_row($result); else $status = 0; if($status & ( STATUS_DONE | STATUS_DELETED )) { echo(mkerror(_('Error processing survey: Survey is not active.'))); return; } if(!($status & STATUS_ACTIVE)) { if(!(isset($test) && $test && ($status & STATUS_TEST))) { echo(mkerror(_('Error processing survey: Survey is not active.'))); return; } } if ($HTTP_POST_VARS['referer'] == $ESPCONFIG['autopub_url']) $HTTP_POST_VARS['referer'] .= "?name=$name"; $num_sections = survey_num_sections($sid); /* bug url_auth sections print $num_sections . "<br>"; print "post <pre> "; print_r($HTTP_POST_VARS); print "</pre><br>"; */ $msg = ''; $action = 'http://' . $HTTP_SERVER_VARS['HTTP_HOST'] . $HTTP_SERVER_VARS['PHP_SELF']; if (auth_get_option('url_tokens')) { // remove unnecessary stuff from query string $qs = preg_replace("/userid=\S+&?|p=\S+&?|sid=\S+&?/", "", $HTTP_SERVER_VARS['QUERY_STRING']); if (strlen($qs)) $action .= "?" . $qs; } elseif (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) { $action .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } //print "<pre>";print_r($HTTP_POST_VARS);print "</pre>"; if(!empty($HTTP_POST_VARS['submit']) || (isset($HTTP_POST_VARS['alt_submit']) && $HTTP_POST_VARS['alt_submit'] == 'Submit Survey')) { $msg = response_check_required($sid,$HTTP_POST_VARS['sec']); if(empty($msg)) { if ($ESPCONFIG['auth_response'] && auth_get_option('resume')) { response_delete($sid, $HTTP_POST_VARS['rid'], $HTTP_POST_VARS['sec']); } $HTTP_POST_VARS['rid'] = response_insert($sid,$HTTP_POST_VARS['sec'],$HTTP_POST_VARS['rid']); response_commit($HTTP_POST_VARS['rid']); response_send_email($sid,$HTTP_POST_VARS['rid']); if (auth_get_option('anonymous')) response_anonymize($HTTP_POST_VARS['userid'], false); // NULLs respondent.email // goto_thankyou($sid,$HTTP_POST_VARS['referer'], auth_get_option('urltokens')); goto_thankyou($sid,$HTTP_POST_VARS['referer'], true); return; } } if(!empty($HTTP_POST_VARS['resume']) && $ESPCONFIG['auth_response'] && auth_get_option('resume')) { response_delete($sid, $HTTP_POST_VARS['rid'], $HTTP_POST_VARS['sec']); $HTTP_POST_VARS['rid'] = response_insert($sid,$HTTP_POST_VARS['sec'],$HTTP_POST_VARS['rid']); if (auth_get_option('anonymous')) response_anonymize($HTTP_POST_VARS['userid']); if (auth_get_option('url_tokens')) { if ($action == $ESPCONFIG['autopub_url']) { goto_saved("$action?name=$name&userid={$HTTP_POST_VARS['userid']}&p=$esppass&sid=$sid"); } else { goto_saved($action); //TEST } return; } else { if ($action == $ESPCONFIG['autopub_url']) { goto_saved("$action?name=$name"); } else { goto_saved($action); } return; } } if(!empty($HTTP_POST_VARS['next'])) { $msg = response_check_required($sid,$HTTP_POST_VARS['sec']); if(empty($msg)) { if ($ESPCONFIG['auth_response'] && auth_get_option('resume')) response_delete($sid, $HTTP_POST_VARS['rid'], $HTTP_POST_VARS['sec']); $HTTP_POST_VARS['rid'] = response_insert($sid,$HTTP_POST_VARS['sec'],$HTTP_POST_VARS['rid']); if (auth_get_option('anonymous')) response_anonymize($HTTP_POST_VARS['userid']); $HTTP_POST_VARS['sec']++; } } if (!empty($HTTP_POST_VARS['prev']) && $ESPCONFIG['auth_response'] && auth_get_option('navigate')) { if(empty($msg)) { if (auth_get_option('resume')) response_delete($sid, $HTTP_POST_VARS['rid'], $HTTP_POST_VARS['sec']); $HTTP_POST_VARS['rid'] = response_insert($sid,$HTTP_POST_VARS['sec'],$HTTP_POST_VARS['rid']); if (auth_get_option('anonymous')) response_anonymize($HTTP_POST_VARS['userid']); $HTTP_POST_VARS['sec']--; } } if ($ESPCONFIG['auth_response'] && auth_get_option('resume')) response_import_sec($sid, $HTTP_POST_VARS['rid'], $HTTP_POST_VARS['sec']); /* (auth_get_option('resume')) ? print "res=y" : print "res=n"; print "<p><pre>"; // print_r($GLOBALS); print "<p></pre>"; */ ?> <script language="JavaScript"> <!-- // Begin <?php // This should really go into <head> tag ?> function other_check(name) { other = name.split("_"); var f = document.phpesp_response; for (var i=0; i<=f.elements.length; i++) { if (f.elements[i].value == "other_"+other[1]) { f.elements[i].checked=true; break; } } } // End --> </script> <form method="post" name="phpesp_response" action="<?php echo($action); ?>"> <input type="hidden" name="referer" value="<?php echo htmlspecialchars($HTTP_POST_VARS['referer']); ?>"> <input type="hidden" name="userid" value="<?php echo($HTTP_POST_VARS['userid']); ?>"> <?php if (auth_get_option('url_tokens')) { print "<input type=\"hidden\" name=\"p\" value=\"$esppass\">"; } ?> <input type="hidden" name="sid" value="<?php echo($sid); ?>"> <input type="hidden" name="rid" value="<?php echo($HTTP_POST_VARS['rid']); ?>"> <input type="hidden" name="sec" value="<?php echo($HTTP_POST_VARS['sec']); ?>"> <?php survey_render($sid,$HTTP_POST_VARS['sec'],$msg); ?> <?php if ($ESPCONFIG['auth_response']) { if (auth_get_option('navigate') && $HTTP_POST_VARS['sec'] > 1) { ?> <input type="submit" name="prev" value="Previous Page"> <?php } if ( (auth_get_option('resume')) && (!auth_get_option('url_tokens'))) { ?> <input type="submit" name="resume" value="Save"> <?php } } if($HTTP_POST_VARS['sec'] == $num_sections) { ?> <!-- prevent form from being submitted by enter key. --> <!-- input type="submit" name="submit" value="Submit Survey" --> <input type="hidden" name="alt_submit" value="Submit Survey"> <input type="button" value="Submit Survey" onClick="this.form.submit()"> <?php } else { ?> <input type="submit" name="next" value="Next Page"> <?php } ?> </form> </pre> |
From: Johan G. <Joh...@co...> - 2003-11-25 16:06:37
|
Hi, Can someone tell me how to remove the results from 1 respondent? I now did it to set the COMPLETE to N. But I want to remove all the stuff that this person submitted. I know how to find out which id he.she has. Why? Well that is my next question. How can I disable the enter key? When people start a survey and hit enter, the form is submitted. (yeah I could use the option that all answers are required). But you guess it, the survey is not jet complete. I searched around for something to disable the enter key, but I see that there is a little javascript that does something before sending. anyone? Thanks, Johan |
From: Stefan C. <sch...@ea...> - 2003-11-21 18:09:59
|
ALthough this has not been tested yet on Oracle, here's the script I use to make th PHPEsp DB (it works fine on PostgreSQL). I hope to have only minor modifications to do to make it work for Oracle... Please note that I have also slightly changed the meaning of some fields, added several fields and a lot of constraints. I don't know if any on this is really useful to you (since it's somewhat away from the original phpESP), but I'm sure it can give some ideas (good or bad, you tell me :)) stF |
From: Stefan C. <sch...@ea...> - 2003-11-21 06:42:49
|
Just came to know about "http://www.azzurri.jp/en/software/clay/index.js", may be useful as well (and looks much more polished than dbModeller) stF > Oh.... > > Hmm, to tell you the truth, that's precisely the kind of stuff I don't want > to do. The reason is very simple : if I store a date in a db, then the > colum in which the data is stored must be of the date type. It's just > better. That's why I'm into all those protability troubles. (no offense > hey, I'mp sure you'll get my point). > > stF > > > For the timestamp definition, I just used varchar2(14) - See the Oracle > > table definitions. As long as the time is in yyyymmddhhmiss format it > > ought to be able to be treated like a string. > > > > >>> "Stefan Champailler" <sch...@ea...> 11/19/03 12:59PM >>> > > > > Thanks for the big update Charles ! > > > > Just when I thought I was done with the Oracle schema, I just discovered > > that TIMESTAMP is not supported. I'll have to delay the post of my shcema > > here until I fix that (hopefully by this week). > > > > My dbadmin also asked me to draw him a conceptual presentation of the > > tables and theire relations... Boring job. I'm actually tweaking > > dbmodeller (a free software) to do it automatically. More on that later > > if someone is interested (and if I finish the tweak :)) > > > > stF > > > > > Let's make all mysql declarations of 'NOT NULL default ', become NULL > > > by definition. It appears that Oracle will have to be dealt with in > > > the at the code level when dealing with the mysql empty string. We may > > > be able to abstract this to by passing the query statement through some > > > type of parser, but I'm not sure how clean this would be. > > > > > > So far, it looks like we've got Stephan, Sean and Jeremy Buchman who > > > have volunteered on this project. I'll try and get the schema for > > > Oracle in my next email to you all. This should firm up the datbase > > > design for the Oracle schema. > > > > > > I'm thinking that by using the PEAR DB library, those wanting to stay > > > with mysql could just substitute the PEAR DB calls in your unit > > > testing, as you go. So, whether using PEAR DB in some calls and direct > > > mysql calls in others, it should work. > > > > > > I've attached oracleIncBeta.php, the Oracle versions for all the mysql > > > calls I have identified as being used in the phpESP. Most were pretty > > > straigt-forward to handle. There was one that I'd like to see if we > > > can dispose of, however. See if you can guess which one it is. > > > > > > Please take a look at these routines (there mysql counterpart would be > > > mysql_connect for oracleConnect, mysql_close for oracleClose, etc.) > > > and assist in identfying the PEAR DB function that would take it's > > > place. > > > > > > I'd like to propose we use ORACLE as the test platform. Or at least, > > > I'd like to see the end product work with Oracle as one of the standard > > > databases. I'll attach the Oracle schema in my next posting. > > > > > > There are 13 functions. If you would like to sign up for one, please > > > mark your name or initials next to the routine. > > > > > > Please list the name of the identical PEAR DB fuction, if there is on. > > > If not please indicate. Mark TESTED with an 'x/ORACLE' to show test > > > complete on Oracle platform. Mark INIT with your initials and then add > > > a date when test complete. ex. cws. ex. cws-11/18/03 > > > > > > function PEAR DB > > > TESTED/Platform INIT/Date > > > ================== =================== > > > ================ ======== oracleConnect > > > oracleClose > > > oracleQuery > > > oracleFetchArray > > > oracleNumRows > > > oracleExecuteQuery > > > oracleFetchRow > > > oracleError() > > > oracleFreeResult > > > oracleInsertId > > > oracleResult > > > oracleSelectDB > > > oracleAffectedRows > > > > > > Charlie > > > 11/18/03 > > > > > > Charlie Smith wrote on 10/24/03 10:26AM: > > > <snip> > > > Calling for help - W O U L D A N Y O N E B E > > > INTERESTED IN ASSISTING WITH THE PORT OF MYSQL TO PEAR DB? If so, > > > please respond, and I'll try and divy out assignments. </snip> > > > > > > >>> "Charlie Smith" <Sm...@ld...> 10/06/03 07:28AM >>> > > > > > > So code would be modified to be: > > > if (mystring=='') > > > mysql='select * from designer where username is null'; > > > else > > > mysql='select * from designer where username = ' + > > > quotefunc(mystring); > > > > > > See > > > http://www.tek-tips.com/viewthread.cfm?spid=759&newpid=759&sqid=657480 > > > for further discussion on topic of empty string. > > > > > > >>> "Charlie Smith" <Sm...@ld...> 10/02/03 01:51PM >>> > > > > > > Yes, the use of PEARDB should make the long if's largely unnecessary. > > > > > > For field definitions, I'd be inclined to go with NULLs as well. We'd > > > use the NULL and NOT NULL qualifier in the field definitions and work > > > out the default values in the code. So we'd keep fields defined as NOT > > > NULL in Oracle. The field definition of fieldname ... NOT NULL > > > default '' is not valid in Oracle. Also, in Oracle, NULL fields are > > > detected differently that fields with data in them when using a select > > > statement. ie. select * from table where field IS null would be the > > > code for going against the Oracle table rather than select * from > > > table where field = null (This is an invalid select as you have to > > > use 'is' and 'is not' null when detecting null fields in the oracle > > > tables, not = and !=. So if there is code in phpESP which references > > > empty string in select statements, it would need to be modified. > > > > > > I had thought we may want to replace the NOT NULL default '' with just > > > default ' '. But had my reservations. Thanks for your input on this, > > > though I confess I am still a bit confused. In Oracle if there is no > > > supplied value for a nullable field (any field not declared as NOT > > > NULL), it's value is NULL by default. If you had a choice between > > > default NULL and NOT NULL, which would you want to go with? > > > > > > For following fields we could translate to Oracle as follows? > > > > > > MySQL becomes Oracle > > > int(10) unsigned NOT NULL default '0' NOT NULL > > > default NULL, NULL > > > int(10) unsigned default '0' default 0 > > > enum('Y','N') NOT NULL default 'N' NOT NULL (with check > > > constraint *) NOT NULL default '' NOT > > > NULL > > > > > > > > > * check constraint syntax: > > > alter table designer > > > add constraint designer_pdesign_ck > > > check (pdesign in ('Y','N')); > > > > > > We could also put a trigger on the table/field so that on insert or > > > update, if the new field value were null, it would get populated with > > > 'N'. We could handle all the other default values this way except for > > > the empty string ''. We'd have to modify the code for this where it > > > selects from table where field = ''. > > > > > > For ENUM types, a check constraint can be used in Oracle, to make sure > > > values are matched against those we want to allow. What would the > > > syntax look like in PostGres? > > > > > > Does this sound agreeable? > > > > > > >>> "James E. Flemer" <jf...@uv...> 10/01/03 06:43PM >>> > > > > > > Jeremy Buchmann wrote: > > > > On Wednesday, October 1, 2003, at 02:13 PM, Stefan Champailler wrote: > > > >>> With that: > > > >>> Let's discuss how to handle the schemas > > > >>> 1) ENUM type in PostGreSQL and Oracle. > > > >>> 2) the empty string in default values > > > >>> 3) default values vs NOT NULL > > > >> > > > >> My Oracle and PostgreSQL is limited, so I ask the question : are we > > > >> planning > > > >> to make severeal schema with the hope to have minimum code rewrite > > > >> on the phpESP side ? (I guess it makes sense). > > > > > > > > I think it's best to work out a schema that: > > > > > > > > 1. Is as generic as possible so we can avoid or minimize code like > > > > this: > > > > > > > > if ($DB == "mysql") { > > > > do something... > > > > } > > > > elseif ($DB == "postgresql") { > > > > do something else... > > > > } > > > > elseif ($DB == "oracle") { > > > > etc, etc > > > > } > > > > > > > > 2. Is still functionally the same as the current one (I don't think > > > > anyone wants to get into a database redesign). Let me clarify > > > > that...it's not just functionally the same, it is the same except we > > > > may change some data types to something more generic and rename some > > > > fields to avoid keyword collisions. > > > > > > > > So it would be the same generic schema for each database, but > > > > different creation scripts and things like that. At least, that's > > > > how I envision it. > > > > > > Please, please avoid huge if/else blocks if possible. (Even if I did > > > not in the past.) I think that PEAR::DB will help avoid this in most > > > cases. By making phpESP database engine independant, use of neat DB > > > features will likely have to be sacrificed. When it comes down to it, > > > if a suitible ``enum'' type does not exist accross the board (in a way > > > that will be acessible with the same SQL query), then just use a > > > numeric type, and map it to an enumeration only inside the PHP code. > > > If NULL is not available as a default, don't use it, use -1 and remap > > > all internal representation that needs it. I really hope that NULL > > > will be an option, because it is the best way to represent the lack of > > > a value. NULL is especially important in the response data to indicate > > > that the question was left blank. Perhaps, we will have to avoid > > > counting on defaults all together, and explicitly set all fields from > > > the code. > > > > > > If all else fails, and there is someplace where it looks like an > > > if/else is needed, then try to avoid it with OO/polymorphism. This may > > > be a better general approach anyway, with objects representing the > > > database tables. > > > > > > I have consitently found that some of the phpesp data is poorly suited > > > for storage in a relational db. This is compounded by the fact that > > > mysql (which was the initial customer reqirement) was much happier with > > > a few tables with lots of records than lots of tables with few records. > > > I believe XML w/ a well desinged schema/dtd (using some unknown sort > > > of storage) would be far better for the representation of the survey > > > data (and could provide multi-lingual support much more redily than the > > > current organization). User/group tables are probably best done with > > > some traditional db or directory (SQL or LDAP). > > > > > > -James > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > phpESP-devel mailing list > > > php...@li... > > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > > > > ----------------------------------------------------------------------- > > >-- -- --- This message may contain confidential information, and is > > > intended only for the use of the individual(s) to whom it is addressed. > > > > > > > > > ======================================================================= > > >== == === > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > phpESP-devel mailing list > > > php...@li... > > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > > > > ----------------------------------------------------------------------- > > >-- -- --- This message may contain confidential information, and is > > > intended only for the use of the individual(s) to whom it is addressed. > > > > > > > > > ======================================================================= > > >== == === > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > phpESP-devel mailing list > > > php...@li... > > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF. Net email is sponsored by: GoToMyPC > > > GoToMyPC is the fast, easy and secure way to access your computer from > > > any Web browser or wireless device. Click here to Try it Free! > > > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmp > > >l _______________________________________________ > > > phpESP-devel mailing list > > > php...@li... > > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > Does SourceForge.net help you be more productive? Does it > > help you create better code? SHARE THE LOVE, and help us help > > YOU! Click Here: http://sourceforge.net/donate/ > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > ------------------------------------------------------------------------- > >-- --- This message may contain confidential information, and is intended > > only for the use of the individual(s) to whom it is addressed. > > > > > > ========================================================================= > >== === > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel |
From: Stefan C. <sch...@ea...> - 2003-11-21 05:57:30
|
Oh.... Hmm, to tell you the truth, that's precisely the kind of stuff I don't want to do. The reason is very simple : if I store a date in a db, then the colum in which the data is stored must be of the date type. It's just better. That's why I'm into all those protability troubles. (no offense hey, I'mp sure you'll get my point). stF > For the timestamp definition, I just used varchar2(14) - See the Oracle > table definitions. As long as the time is in yyyymmddhhmiss format it > ought to be able to be treated like a string. > > >>> "Stefan Champailler" <sch...@ea...> 11/19/03 12:59PM >>> > > Thanks for the big update Charles ! > > Just when I thought I was done with the Oracle schema, I just discovered > that TIMESTAMP is not supported. I'll have to delay the post of my shcema > here until I fix that (hopefully by this week). > > My dbadmin also asked me to draw him a conceptual presentation of the > tables and theire relations... Boring job. I'm actually tweaking dbmodeller > (a free software) to do it automatically. More on that later if someone is > interested (and if I finish the tweak :)) > > stF > > > Let's make all mysql declarations of 'NOT NULL default ', become NULL by > > definition. It appears that Oracle will have to be dealt with in the at > > the code level when dealing with the mysql empty string. We may be able > > to abstract this to by passing the query statement through some type of > > parser, but I'm not sure how clean this would be. > > > > So far, it looks like we've got Stephan, Sean and Jeremy Buchman who have > > volunteered on this project. I'll try and get the schema for Oracle in > > my next email to you all. This should firm up the datbase design for the > > Oracle schema. > > > > I'm thinking that by using the PEAR DB library, those wanting to stay > > with mysql could just substitute the PEAR DB calls in your unit testing, > > as you go. So, whether using PEAR DB in some calls and direct mysql > > calls in others, it should work. > > > > I've attached oracleIncBeta.php, the Oracle versions for all the mysql > > calls I have identified as being used in the phpESP. Most were pretty > > straigt-forward to handle. There was one that I'd like to see if we can > > dispose of, however. See if you can guess which one it is. > > > > Please take a look at these routines (there mysql counterpart would be > > mysql_connect for oracleConnect, mysql_close for oracleClose, etc.) and > > assist in identfying the PEAR DB function that would take it's place. > > > > I'd like to propose we use ORACLE as the test platform. Or at least, I'd > > like to see the end product work with Oracle as one of the standard > > databases. I'll attach the Oracle schema in my next posting. > > > > There are 13 functions. If you would like to sign up for one, please > > mark your name or initials next to the routine. > > > > Please list the name of the identical PEAR DB fuction, if there is on. > > If not please indicate. Mark TESTED with an 'x/ORACLE' to show test > > complete on Oracle platform. Mark INIT with your initials and then add a > > date when test complete. ex. cws. ex. cws-11/18/03 > > > > function PEAR DB > > TESTED/Platform INIT/Date > > ================== =================== > > ================ ======== oracleConnect > > oracleClose > > oracleQuery > > oracleFetchArray > > oracleNumRows > > oracleExecuteQuery > > oracleFetchRow > > oracleError() > > oracleFreeResult > > oracleInsertId > > oracleResult > > oracleSelectDB > > oracleAffectedRows > > > > Charlie > > 11/18/03 > > > > Charlie Smith wrote on 10/24/03 10:26AM: > > <snip> > > Calling for help - W O U L D A N Y O N E B E > > INTERESTED IN ASSISTING WITH THE PORT OF MYSQL TO PEAR DB? If so, please > > respond, and I'll try and divy out assignments. </snip> > > > > >>> "Charlie Smith" <Sm...@ld...> 10/06/03 07:28AM >>> > > > > So code would be modified to be: > > if (mystring=='') > > mysql='select * from designer where username is null'; > > else > > mysql='select * from designer where username = ' + quotefunc(mystring); > > > > See > > http://www.tek-tips.com/viewthread.cfm?spid=759&newpid=759&sqid=657480 > > for further discussion on topic of empty string. > > > > >>> "Charlie Smith" <Sm...@ld...> 10/02/03 01:51PM >>> > > > > Yes, the use of PEARDB should make the long if's largely unnecessary. > > > > For field definitions, I'd be inclined to go with NULLs as well. We'd > > use the NULL and NOT NULL qualifier in the field definitions and work out > > the default values in the code. So we'd keep fields defined as NOT NULL > > in Oracle. The field definition of fieldname ... NOT NULL default '' > > is not valid in Oracle. Also, in Oracle, NULL fields are detected > > differently that fields with data in them when using a select statement. > > ie. select * from table where field IS null would be the code for > > going against the Oracle table rather than select * from table where > > field = null (This is an invalid select as you have to use 'is' and > > 'is not' null when detecting null fields in the oracle tables, not = and > > !=. So if there is code in phpESP which references empty string in > > select statements, it would need to be modified. > > > > I had thought we may want to replace the NOT NULL default '' with just > > default ' '. But had my reservations. Thanks for your input on this, > > though I confess I am still a bit confused. In Oracle if there is no > > supplied value for a nullable field (any field not declared as NOT NULL), > > it's value is NULL by default. If you had a choice between default NULL > > and NOT NULL, which would you want to go with? > > > > For following fields we could translate to Oracle as follows? > > > > MySQL becomes Oracle > > int(10) unsigned NOT NULL default '0' NOT NULL > > default NULL, NULL > > int(10) unsigned default '0' default 0 > > enum('Y','N') NOT NULL default 'N' NOT NULL (with check > > constraint *) NOT NULL default '' NOT > > NULL > > > > > > * check constraint syntax: > > alter table designer > > add constraint designer_pdesign_ck > > check (pdesign in ('Y','N')); > > > > We could also put a trigger on the table/field so that on insert or > > update, if the new field value were null, it would get populated with > > 'N'. We could handle all the other default values this way except for > > the empty string ''. We'd have to modify the code for this where it > > selects from table where field = ''. > > > > For ENUM types, a check constraint can be used in Oracle, to make sure > > values are matched against those we want to allow. What would the syntax > > look like in PostGres? > > > > Does this sound agreeable? > > > > >>> "James E. Flemer" <jf...@uv...> 10/01/03 06:43PM >>> > > > > Jeremy Buchmann wrote: > > > On Wednesday, October 1, 2003, at 02:13 PM, Stefan Champailler wrote: > > >>> With that: > > >>> Let's discuss how to handle the schemas > > >>> 1) ENUM type in PostGreSQL and Oracle. > > >>> 2) the empty string in default values > > >>> 3) default values vs NOT NULL > > >> > > >> My Oracle and PostgreSQL is limited, so I ask the question : are we > > >> planning > > >> to make severeal schema with the hope to have minimum code rewrite on > > >> the phpESP side ? (I guess it makes sense). > > > > > > I think it's best to work out a schema that: > > > > > > 1. Is as generic as possible so we can avoid or minimize code like > > > this: > > > > > > if ($DB == "mysql") { > > > do something... > > > } > > > elseif ($DB == "postgresql") { > > > do something else... > > > } > > > elseif ($DB == "oracle") { > > > etc, etc > > > } > > > > > > 2. Is still functionally the same as the current one (I don't think > > > anyone wants to get into a database redesign). Let me clarify > > > that...it's not just functionally the same, it is the same except we > > > may change some data types to something more generic and rename some > > > fields to avoid keyword collisions. > > > > > > So it would be the same generic schema for each database, but different > > > creation scripts and things like that. At least, that's how I envision > > > it. > > > > Please, please avoid huge if/else blocks if possible. (Even if I did > > not in the past.) I think that PEAR::DB will help avoid this in most > > cases. By making phpESP database engine independant, use of neat DB > > features will likely have to be sacrificed. When it comes down to it, > > if a suitible ``enum'' type does not exist accross the board (in a way > > that will be acessible with the same SQL query), then just use a numeric > > type, and map it to an enumeration only inside the PHP code. If NULL is > > not available as a default, don't use it, use -1 and remap all internal > > representation that needs it. I really hope that NULL will be an > > option, because it is the best way to represent the lack of a value. > > NULL is especially important in the response data to indicate that the > > question was left blank. Perhaps, we will have to avoid counting on > > defaults all together, and explicitly set all fields from the code. > > > > If all else fails, and there is someplace where it looks like an if/else > > is needed, then try to avoid it with OO/polymorphism. This may be a > > better general approach anyway, with objects representing the database > > tables. > > > > I have consitently found that some of the phpesp data is poorly suited > > for storage in a relational db. This is compounded by the fact that > > mysql (which was the initial customer reqirement) was much happier with > > a few tables with lots of records than lots of tables with few records. > > I believe XML w/ a well desinged schema/dtd (using some unknown sort > > of storage) would be far better for the representation of the survey > > data (and could provide multi-lingual support much more redily than the > > current organization). User/group tables are probably best done with > > some traditional db or directory (SQL or LDAP). > > > > -James > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > ------------------------------------------------------------------------- > >-- --- This message may contain confidential information, and is intended > > only for the use of the individual(s) to whom it is addressed. > > > > > > ========================================================================= > >== === > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > ------------------------------------------------------------------------- > >-- --- This message may contain confidential information, and is intended > > only for the use of the individual(s) to whom it is addressed. > > > > > > ========================================================================= > >== === > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > > > > > ------------------------------------------------------- > > This SF. Net email is sponsored by: GoToMyPC > > GoToMyPC is the fast, easy and secure way to access your computer from > > any Web browser or wireless device. Click here to Try it Free! > > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > --------------------------------------------------------------------------- >--- This message may contain confidential information, and is intended only > for the use of the individual(s) to whom it is addressed. > > > =========================================================================== >=== |
From: Charlie S. <Sm...@ld...> - 2003-11-20 16:46:39
|
=46or the timestamp definition, I just used varchar2(14) - See the Oracle = table definitions. As long as the time is in yyyymmddhhmiss format it ough= t= to be able to be treated like a string. >>> "Stefan Champailler" <sch...@ea...> 11/19/03 12:59PM >>> Thanks for the big update Charles ! Just when I thought I was done with the Oracle schema, I just discovered = that=20 TIMESTAMP is not supported. I'll have to delay the post of my shcema here=20 until I fix that (hopefully by this week). My dbadmin also asked me to draw him a conceptual presentation of the table= s= =20 and theire relations... Boring job. I'm actually tweaking dbmodeller (a fre= e= =20 software) to do it automatically. More on that later if someone is = interested=20 (and if I finish the tweak :)) stF > Let's make all mysql declarations of 'NOT NULL default ', become NULL by > definition. It appears that Oracle will have to be dealt with in the at > the code level when dealing with the mysql empty string. We may be able = to > abstract this to by passing the query statement through some type of > parser, but I'm not sure how clean this would be. > > So far, it looks like we've got Stephan, Sean and Jeremy Buchman who have > volunteered on this project. I'll try and get the schema for Oracle in > my next email to you all. This should firm up the datbase design for the > Oracle schema. > > I'm thinking that by using the PEAR DB library, those wanting to stay with > mysql could just substitute the PEAR DB calls in your unit testing, as you > go. So, whether using PEAR DB in some calls and direct mysql calls in > others, it should work. > > I've attached oracleIncBeta.php, the Oracle versions for all the mysql > calls I have identified as being used in the phpESP. Most were pretty > straigt-forward to handle. There was one that I'd like to see if we can > dispose of, however. See if you can guess which one it is. > > Please take a look at these routines (there mysql counterpart would be > mysql_connect for oracleConnect, mysql_close for oracleClose, etc.) and > assist in identfying the PEAR DB function that would take it's place. > > I'd like to propose we use ORACLE as the test platform. Or at least, I'd > like to see the end product work with Oracle as one of the standard > databases. I'll attach the Oracle schema in my next posting. > > There are 13 functions. If you would like to sign up for one, please mark > your name or initials next to the routine. > > Please list the name of the identical PEAR DB fuction, if there is on. If > not please indicate. Mark TESTED with an 'x/ORACLE' to show test complete > on Oracle platform. Mark INIT with your initials and then add a date when > test complete. ex. cws. ex. cws-11/18/03 > > function PEAR DB = = =20 > TESTED/Platform INIT/Date > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D oracleConnect > oracleClose > oracleQuery > oracleFetchArray > oracleNumRows > oracleExecuteQuery > oracleFetchRow > oracleError() > oracleFreeResult > oracleInsertId > oracleResult > oracleSelectDB > oracleAffectedRows > > Charlie > 11/18/03 > > Charlie Smith wrote on 10/24/03 10:26AM: > <snip> > Calling for help - W O U L D A N Y O N E B E INTERESTED > IN ASSISTING WITH THE PORT OF MYSQL TO PEAR DB? If so, please respond, = and > I'll try and divy out assignments. </snip> > > >>> "Charlie Smith" <Sm...@ld...> 10/06/03 07:28AM >>> > > So code would be modified to be: > if (mystring=3D=3D'') > mysql=3D'select * from designer where username is null'; > else > mysql=3D'select * from designer where username =3D ' + = quotefunc(mystring); > > See = http://www.tek-tips.com/viewthread.cfm?spid=3D759&newpid=3D759&sqid=3D65748= 0= =20 > for further discussion on topic of empty string. > > >>> "Charlie Smith" <Sm...@ld...> 10/02/03 01:51PM >>> > > Yes, the use of PEARDB should make the long if's largely unnecessary. > > For field definitions, I'd be inclined to go with NULLs as well. We'd use > the NULL and NOT NULL qualifier in the field definitions and work out the > default values in the code. So we'd keep fields defined as NOT NULL in > Oracle. The field definition of fieldname ... NOT NULL default '' is = not > valid in Oracle. Also, in Oracle, NULL fields are detected differently > that fields with data in them when using a select statement. ie. select * > from table where field IS null would be the code for going against the > Oracle table rather than select * from table where field =3D null = (This > is an invalid select as you have to use 'is' and 'is not' null when > detecting null fields in the oracle tables, not =3D and !=3D. So if = there is > code in phpESP which references empty string in select statements, it = would > need to be modified. > > I had thought we may want to replace the NOT NULL default '' with just > default ' '. But had my reservations. Thanks for your input on this, > though I confess I am still a bit confused. In Oracle if there is no > supplied value for a nullable field (any field not declared as NOT NULL), > it's value is NULL by default. If you had a choice between default NULL > and NOT NULL, which would you want to go with? > > For following fields we could translate to Oracle as follows? > > MySQL becomes Oracle > int(10) unsigned NOT NULL default '0' NOT NULL > default NULL, NULL > int(10) unsigned default '0' default 0 > enum('Y','N') NOT NULL default 'N' NOT NULL (with check = constraint > *) NOT NULL default '' NOT NULL > > > * check constraint syntax: > alter table designer > add constraint designer_pdesign_ck > check (pdesign in ('Y','N')); > > We could also put a trigger on the table/field so that on insert or = update, > if the new field value were null, it would get populated with 'N'. We > could handle all the other default values this way except for the empty > string ''. We'd have to modify the code for this where it selects from > table where field =3D ''. > > For ENUM types, a check constraint can be used in Oracle, to make sure > values are matched against those we want to allow. What would the syntax > look like in PostGres? > > Does this sound agreeable? > > >>> "James E. Flemer" <jf...@uv...> 10/01/03 06:43PM >>> > > Jeremy Buchmann wrote: > > On Wednesday, October 1, 2003, at 02:13 PM, Stefan Champailler wrote: > >>> With that: > >>> Let's discuss how to handle the schemas > >>> 1) ENUM type in PostGreSQL and Oracle. > >>> 2) the empty string in default values > >>> 3) default values vs NOT NULL > >> > >> My Oracle and PostgreSQL is limited, so I ask the question : are we > >> planning > >> to make severeal schema with the hope to have minimum code rewrite on > >> the phpESP side ? (I guess it makes sense). > > > > I think it's best to work out a schema that: > > > > 1. Is as generic as possible so we can avoid or minimize code like > > this: > > > > if ($DB =3D=3D "mysql") { > > do something... > > } > > elseif ($DB =3D=3D "postgresql") { > > do something else... > > } > > elseif ($DB =3D=3D "oracle") { > > etc, etc > > } > > > > 2. Is still functionally the same as the current one (I don't think > > anyone wants to get into a database redesign). Let me clarify > > that...it's not just functionally the same, it is the same except we may > > change some data types to something more generic and rename some fields > > to avoid keyword collisions. > > > > So it would be the same generic schema for each database, but different > > creation scripts and things like that. At least, that's how I envision > > it. > > Please, please avoid huge if/else blocks if possible. (Even if I did > not in the past.) I think that PEAR::DB will help avoid this in most > cases. By making phpESP database engine independant, use of neat DB > features will likely have to be sacrificed. When it comes down to it, > if a suitible ``enum'' type does not exist accross the board (in a way > that will be acessible with the same SQL query), then just use a numeric > type, and map it to an enumeration only inside the PHP code. If NULL is > not available as a default, don't use it, use -1 and remap all internal > representation that needs it. I really hope that NULL will be an > option, because it is the best way to represent the lack of a value. > NULL is especially important in the response data to indicate that the > question was left blank. Perhaps, we will have to avoid counting on > defaults all together, and explicitly set all fields from the code. > > If all else fails, and there is someplace where it looks like an if/else > is needed, then try to avoid it with OO/polymorphism. This may be a > better general approach anyway, with objects representing the database > tables. > > I have consitently found that some of the phpesp data is poorly suited > for storage in a relational db. This is compounded by the fact that > mysql (which was the initial customer reqirement) was much happier with > a few tables with lots of records than lots of tables with few records. > I believe XML w/ a well desinged schema/dtd (using some unknown sort > of storage) would be far better for the representation of the survey > data (and could provide multi-lingual support much more redily than the > current organization). User/group tables are probably best done with > some traditional db or directory (SQL or LDAP). > > -James > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf=20 > _______________________________________________ > phpESP-devel mailing list > php...@li...=20 > https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 > > > = --------------------------------------------------------------------------- >--- This message may contain confidential information, and is intended only > for the use of the individual(s) to whom it is addressed. > > > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=3D=3D=3D > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf=20 > _______________________________________________ > phpESP-devel mailing list > php...@li...=20 > https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 > > > = --------------------------------------------------------------------------- >--- This message may contain confidential information, and is intended only > for the use of the individual(s) to whom it is addressed. > > > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=3D=3D=3D > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf=20 > _______________________________________________ > phpESP-devel mailing list > php...@li...=20 > https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 > > > > > ------------------------------------------------------- > This SF. Net email is sponsored by: GoToMyPC > GoToMyPC is the fast, easy and secure way to access your computer from > any Web browser or wireless device. Click here to Try it Free! > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=3Dmm/g22lp.tmp= l= =20 > _______________________________________________ > phpESP-devel mailing list > php...@li...=20 > https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/=20 _______________________________________________ phpESP-devel mailing list php...@li...=20 https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 ---------------------------------------------------------------------------= --- This message may contain confidential information, and is intended only for= = the use of the individual(s) to whom it is addressed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D |
From: Matthew G. <gr...@mu...> - 2003-11-19 20:04:13
|
FYI: If you're modeling PostgreSQL, Autdoc[1] is worth looking at. [1] http://www.rbt.ca/autodoc/ On Wed, 2003-11-19 at 14:59, Stefan Champailler wrote: > Thanks for the big update Charles ! > > Just when I thought I was done with the Oracle schema, I just discovered that > TIMESTAMP is not supported. I'll have to delay the post of my shcema here > until I fix that (hopefully by this week). > > My dbadmin also asked me to draw him a conceptual presentation of the tables > and theire relations... Boring job. I'm actually tweaking dbmodeller (a free > software) to do it automatically. More on that later if someone is interested > (and if I finish the tweak :)) > > stF > > > > Let's make all mysql declarations of 'NOT NULL default ', become NULL by > > definition. It appears that Oracle will have to be dealt with in the at > > the code level when dealing with the mysql empty string. We may be able to > > abstract this to by passing the query statement through some type of > > parser, but I'm not sure how clean this would be. > > > > So far, it looks like we've got Stephan, Sean and Jeremy Buchman who have > > volunteered on this project. I'll try and get the schema for Oracle in > > my next email to you all. This should firm up the datbase design for the > > Oracle schema. > > > > I'm thinking that by using the PEAR DB library, those wanting to stay with > > mysql could just substitute the PEAR DB calls in your unit testing, as you > > go. So, whether using PEAR DB in some calls and direct mysql calls in > > others, it should work. > > > > I've attached oracleIncBeta.php, the Oracle versions for all the mysql > > calls I have identified as being used in the phpESP. Most were pretty > > straigt-forward to handle. There was one that I'd like to see if we can > > dispose of, however. See if you can guess which one it is. > > > > Please take a look at these routines (there mysql counterpart would be > > mysql_connect for oracleConnect, mysql_close for oracleClose, etc.) and > > assist in identfying the PEAR DB function that would take it's place. > > > > I'd like to propose we use ORACLE as the test platform. Or at least, I'd > > like to see the end product work with Oracle as one of the standard > > databases. I'll attach the Oracle schema in my next posting. > > > > There are 13 functions. If you would like to sign up for one, please mark > > your name or initials next to the routine. > > > > Please list the name of the identical PEAR DB fuction, if there is on. If > > not please indicate. Mark TESTED with an 'x/ORACLE' to show test complete > > on Oracle platform. Mark INIT with your initials and then add a date when > > test complete. ex. cws. ex. cws-11/18/03 > > > > function PEAR DB > > TESTED/Platform INIT/Date > > ================== =================== > > ================ ======== oracleConnect > > oracleClose > > oracleQuery > > oracleFetchArray > > oracleNumRows > > oracleExecuteQuery > > oracleFetchRow > > oracleError() > > oracleFreeResult > > oracleInsertId > > oracleResult > > oracleSelectDB > > oracleAffectedRows > > > > Charlie > > 11/18/03 > > > > Charlie Smith wrote on 10/24/03 10:26AM: > > <snip> > > Calling for help - W O U L D A N Y O N E B E INTERESTED > > IN ASSISTING WITH THE PORT OF MYSQL TO PEAR DB? If so, please respond, and > > I'll try and divy out assignments. </snip> > > > > >>> "Charlie Smith" <Sm...@ld...> 10/06/03 07:28AM >>> > > > > So code would be modified to be: > > if (mystring=='') > > mysql='select * from designer where username is null'; > > else > > mysql='select * from designer where username = ' + quotefunc(mystring); > > > > See http://www.tek-tips.com/viewthread.cfm?spid=759&newpid=759&sqid=657480 > > for further discussion on topic of empty string. > > > > >>> "Charlie Smith" <Sm...@ld...> 10/02/03 01:51PM >>> > > > > Yes, the use of PEARDB should make the long if's largely unnecessary. > > > > For field definitions, I'd be inclined to go with NULLs as well. We'd use > > the NULL and NOT NULL qualifier in the field definitions and work out the > > default values in the code. So we'd keep fields defined as NOT NULL in > > Oracle. The field definition of fieldname ... NOT NULL default '' is not > > valid in Oracle. Also, in Oracle, NULL fields are detected differently > > that fields with data in them when using a select statement. ie. select * > > from table where field IS null would be the code for going against the > > Oracle table rather than select * from table where field = null (This > > is an invalid select as you have to use 'is' and 'is not' null when > > detecting null fields in the oracle tables, not = and !=. So if there is > > code in phpESP which references empty string in select statements, it would > > need to be modified. > > > > I had thought we may want to replace the NOT NULL default '' with just > > default ' '. But had my reservations. Thanks for your input on this, > > though I confess I am still a bit confused. In Oracle if there is no > > supplied value for a nullable field (any field not declared as NOT NULL), > > it's value is NULL by default. If you had a choice between default NULL > > and NOT NULL, which would you want to go with? > > > > For following fields we could translate to Oracle as follows? > > > > MySQL becomes Oracle > > int(10) unsigned NOT NULL default '0' NOT NULL > > default NULL, NULL > > int(10) unsigned default '0' default 0 > > enum('Y','N') NOT NULL default 'N' NOT NULL (with check constraint > > *) NOT NULL default '' NOT NULL > > > > > > * check constraint syntax: > > alter table designer > > add constraint designer_pdesign_ck > > check (pdesign in ('Y','N')); > > > > We could also put a trigger on the table/field so that on insert or update, > > if the new field value were null, it would get populated with 'N'. We > > could handle all the other default values this way except for the empty > > string ''. We'd have to modify the code for this where it selects from > > table where field = ''. > > > > For ENUM types, a check constraint can be used in Oracle, to make sure > > values are matched against those we want to allow. What would the syntax > > look like in PostGres? > > > > Does this sound agreeable? > > > > >>> "James E. Flemer" <jf...@uv...> 10/01/03 06:43PM >>> > > > > Jeremy Buchmann wrote: > > > On Wednesday, October 1, 2003, at 02:13 PM, Stefan Champailler wrote: > > >>> With that: > > >>> Let's discuss how to handle the schemas > > >>> 1) ENUM type in PostGreSQL and Oracle. > > >>> 2) the empty string in default values > > >>> 3) default values vs NOT NULL > > >> > > >> My Oracle and PostgreSQL is limited, so I ask the question : are we > > >> planning > > >> to make severeal schema with the hope to have minimum code rewrite on > > >> the phpESP side ? (I guess it makes sense). > > > > > > I think it's best to work out a schema that: > > > > > > 1. Is as generic as possible so we can avoid or minimize code like > > > this: > > > > > > if ($DB == "mysql") { > > > do something... > > > } > > > elseif ($DB == "postgresql") { > > > do something else... > > > } > > > elseif ($DB == "oracle") { > > > etc, etc > > > } > > > > > > 2. Is still functionally the same as the current one (I don't think > > > anyone wants to get into a database redesign). Let me clarify > > > that...it's not just functionally the same, it is the same except we may > > > change some data types to something more generic and rename some fields > > > to avoid keyword collisions. > > > > > > So it would be the same generic schema for each database, but different > > > creation scripts and things like that. At least, that's how I envision > > > it. > > > > Please, please avoid huge if/else blocks if possible. (Even if I did > > not in the past.) I think that PEAR::DB will help avoid this in most > > cases. By making phpESP database engine independant, use of neat DB > > features will likely have to be sacrificed. When it comes down to it, > > if a suitible ``enum'' type does not exist accross the board (in a way > > that will be acessible with the same SQL query), then just use a numeric > > type, and map it to an enumeration only inside the PHP code. If NULL is > > not available as a default, don't use it, use -1 and remap all internal > > representation that needs it. I really hope that NULL will be an > > option, because it is the best way to represent the lack of a value. > > NULL is especially important in the response data to indicate that the > > question was left blank. Perhaps, we will have to avoid counting on > > defaults all together, and explicitly set all fields from the code. > > > > If all else fails, and there is someplace where it looks like an if/else > > is needed, then try to avoid it with OO/polymorphism. This may be a > > better general approach anyway, with objects representing the database > > tables. > > > > I have consitently found that some of the phpesp data is poorly suited > > for storage in a relational db. This is compounded by the fact that > > mysql (which was the initial customer reqirement) was much happier with > > a few tables with lots of records than lots of tables with few records. > > I believe XML w/ a well desinged schema/dtd (using some unknown sort > > of storage) would be far better for the representation of the survey > > data (and could provide multi-lingual support much more redily than the > > current organization). User/group tables are probably best done with > > some traditional db or directory (SQL or LDAP). > > > > -James > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > --------------------------------------------------------------------------- > >--- This message may contain confidential information, and is intended only > > for the use of the individual(s) to whom it is addressed. > > > > > > =========================================================================== > >=== > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > --------------------------------------------------------------------------- > >--- This message may contain confidential information, and is intended only > > for the use of the individual(s) to whom it is addressed. > > > > > > =========================================================================== > >=== > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > > > > > > ------------------------------------------------------- > > This SF. Net email is sponsored by: GoToMyPC > > GoToMyPC is the fast, easy and secure way to access your computer from > > any Web browser or wireless device. Click here to Try it Free! > > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl > > _______________________________________________ > > phpESP-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel -- mcg ------------------------------------- The IT Lab (http://www.itlab.musc.edu) |
From: Stefan C. <sch...@ea...> - 2003-11-19 20:00:53
|
Thanks for the big update Charles ! Just when I thought I was done with the Oracle schema, I just discovered that TIMESTAMP is not supported. I'll have to delay the post of my shcema here until I fix that (hopefully by this week). My dbadmin also asked me to draw him a conceptual presentation of the tables and theire relations... Boring job. I'm actually tweaking dbmodeller (a free software) to do it automatically. More on that later if someone is interested (and if I finish the tweak :)) stF > Let's make all mysql declarations of 'NOT NULL default ', become NULL by > definition. It appears that Oracle will have to be dealt with in the at > the code level when dealing with the mysql empty string. We may be able to > abstract this to by passing the query statement through some type of > parser, but I'm not sure how clean this would be. > > So far, it looks like we've got Stephan, Sean and Jeremy Buchman who have > volunteered on this project. I'll try and get the schema for Oracle in > my next email to you all. This should firm up the datbase design for the > Oracle schema. > > I'm thinking that by using the PEAR DB library, those wanting to stay with > mysql could just substitute the PEAR DB calls in your unit testing, as you > go. So, whether using PEAR DB in some calls and direct mysql calls in > others, it should work. > > I've attached oracleIncBeta.php, the Oracle versions for all the mysql > calls I have identified as being used in the phpESP. Most were pretty > straigt-forward to handle. There was one that I'd like to see if we can > dispose of, however. See if you can guess which one it is. > > Please take a look at these routines (there mysql counterpart would be > mysql_connect for oracleConnect, mysql_close for oracleClose, etc.) and > assist in identfying the PEAR DB function that would take it's place. > > I'd like to propose we use ORACLE as the test platform. Or at least, I'd > like to see the end product work with Oracle as one of the standard > databases. I'll attach the Oracle schema in my next posting. > > There are 13 functions. If you would like to sign up for one, please mark > your name or initials next to the routine. > > Please list the name of the identical PEAR DB fuction, if there is on. If > not please indicate. Mark TESTED with an 'x/ORACLE' to show test complete > on Oracle platform. Mark INIT with your initials and then add a date when > test complete. ex. cws. ex. cws-11/18/03 > > function PEAR DB > TESTED/Platform INIT/Date > ================== =================== > ================ ======== oracleConnect > oracleClose > oracleQuery > oracleFetchArray > oracleNumRows > oracleExecuteQuery > oracleFetchRow > oracleError() > oracleFreeResult > oracleInsertId > oracleResult > oracleSelectDB > oracleAffectedRows > > Charlie > 11/18/03 > > Charlie Smith wrote on 10/24/03 10:26AM: > <snip> > Calling for help - W O U L D A N Y O N E B E INTERESTED > IN ASSISTING WITH THE PORT OF MYSQL TO PEAR DB? If so, please respond, and > I'll try and divy out assignments. </snip> > > >>> "Charlie Smith" <Sm...@ld...> 10/06/03 07:28AM >>> > > So code would be modified to be: > if (mystring=='') > mysql='select * from designer where username is null'; > else > mysql='select * from designer where username = ' + quotefunc(mystring); > > See http://www.tek-tips.com/viewthread.cfm?spid=759&newpid=759&sqid=657480 > for further discussion on topic of empty string. > > >>> "Charlie Smith" <Sm...@ld...> 10/02/03 01:51PM >>> > > Yes, the use of PEARDB should make the long if's largely unnecessary. > > For field definitions, I'd be inclined to go with NULLs as well. We'd use > the NULL and NOT NULL qualifier in the field definitions and work out the > default values in the code. So we'd keep fields defined as NOT NULL in > Oracle. The field definition of fieldname ... NOT NULL default '' is not > valid in Oracle. Also, in Oracle, NULL fields are detected differently > that fields with data in them when using a select statement. ie. select * > from table where field IS null would be the code for going against the > Oracle table rather than select * from table where field = null (This > is an invalid select as you have to use 'is' and 'is not' null when > detecting null fields in the oracle tables, not = and !=. So if there is > code in phpESP which references empty string in select statements, it would > need to be modified. > > I had thought we may want to replace the NOT NULL default '' with just > default ' '. But had my reservations. Thanks for your input on this, > though I confess I am still a bit confused. In Oracle if there is no > supplied value for a nullable field (any field not declared as NOT NULL), > it's value is NULL by default. If you had a choice between default NULL > and NOT NULL, which would you want to go with? > > For following fields we could translate to Oracle as follows? > > MySQL becomes Oracle > int(10) unsigned NOT NULL default '0' NOT NULL > default NULL, NULL > int(10) unsigned default '0' default 0 > enum('Y','N') NOT NULL default 'N' NOT NULL (with check constraint > *) NOT NULL default '' NOT NULL > > > * check constraint syntax: > alter table designer > add constraint designer_pdesign_ck > check (pdesign in ('Y','N')); > > We could also put a trigger on the table/field so that on insert or update, > if the new field value were null, it would get populated with 'N'. We > could handle all the other default values this way except for the empty > string ''. We'd have to modify the code for this where it selects from > table where field = ''. > > For ENUM types, a check constraint can be used in Oracle, to make sure > values are matched against those we want to allow. What would the syntax > look like in PostGres? > > Does this sound agreeable? > > >>> "James E. Flemer" <jf...@uv...> 10/01/03 06:43PM >>> > > Jeremy Buchmann wrote: > > On Wednesday, October 1, 2003, at 02:13 PM, Stefan Champailler wrote: > >>> With that: > >>> Let's discuss how to handle the schemas > >>> 1) ENUM type in PostGreSQL and Oracle. > >>> 2) the empty string in default values > >>> 3) default values vs NOT NULL > >> > >> My Oracle and PostgreSQL is limited, so I ask the question : are we > >> planning > >> to make severeal schema with the hope to have minimum code rewrite on > >> the phpESP side ? (I guess it makes sense). > > > > I think it's best to work out a schema that: > > > > 1. Is as generic as possible so we can avoid or minimize code like > > this: > > > > if ($DB == "mysql") { > > do something... > > } > > elseif ($DB == "postgresql") { > > do something else... > > } > > elseif ($DB == "oracle") { > > etc, etc > > } > > > > 2. Is still functionally the same as the current one (I don't think > > anyone wants to get into a database redesign). Let me clarify > > that...it's not just functionally the same, it is the same except we may > > change some data types to something more generic and rename some fields > > to avoid keyword collisions. > > > > So it would be the same generic schema for each database, but different > > creation scripts and things like that. At least, that's how I envision > > it. > > Please, please avoid huge if/else blocks if possible. (Even if I did > not in the past.) I think that PEAR::DB will help avoid this in most > cases. By making phpESP database engine independant, use of neat DB > features will likely have to be sacrificed. When it comes down to it, > if a suitible ``enum'' type does not exist accross the board (in a way > that will be acessible with the same SQL query), then just use a numeric > type, and map it to an enumeration only inside the PHP code. If NULL is > not available as a default, don't use it, use -1 and remap all internal > representation that needs it. I really hope that NULL will be an > option, because it is the best way to represent the lack of a value. > NULL is especially important in the response data to indicate that the > question was left blank. Perhaps, we will have to avoid counting on > defaults all together, and explicitly set all fields from the code. > > If all else fails, and there is someplace where it looks like an if/else > is needed, then try to avoid it with OO/polymorphism. This may be a > better general approach anyway, with objects representing the database > tables. > > I have consitently found that some of the phpesp data is poorly suited > for storage in a relational db. This is compounded by the fact that > mysql (which was the initial customer reqirement) was much happier with > a few tables with lots of records than lots of tables with few records. > I believe XML w/ a well desinged schema/dtd (using some unknown sort > of storage) would be far better for the representation of the survey > data (and could provide multi-lingual support much more redily than the > current organization). User/group tables are probably best done with > some traditional db or directory (SQL or LDAP). > > -James > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > --------------------------------------------------------------------------- >--- This message may contain confidential information, and is intended only > for the use of the individual(s) to whom it is addressed. > > > =========================================================================== >=== > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > --------------------------------------------------------------------------- >--- This message may contain confidential information, and is intended only > for the use of the individual(s) to whom it is addressed. > > > =========================================================================== >=== > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > > > > > ------------------------------------------------------- > This SF. Net email is sponsored by: GoToMyPC > GoToMyPC is the fast, easy and secure way to access your computer from > any Web browser or wireless device. Click here to Try it Free! > https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel |
From: Charlie S. <Sm...@ld...> - 2003-11-19 19:01:29
|
I got an email saying that this message I'm trying to send to the group wen= t= over the 40KB limit, so I'll break it up. This is the second of two. = You'll need to use MS Word or something like that - maybe Codewrite - to = open the files, unless you can get them to a UNIX (preferred) box. Attached: replace_fields.ksh - korn shell script to run PERL script. process_inet_phpesp_code.pl - PERL script to replace occurrences of mysql = calls with Oracle calls seen in my previous post. >>> "Charlie Smith" <Sm...@ld...> 11/18/03 10:00AM >>> Let's make all mysql declarations of 'NOT NULL default ', become NULL by = definition. It appears that Oracle will have to be dealt with in the at = the code level when dealing with the mysql empty string. We may be able to= = abstract this to by passing the query statement through some type of parser= ,= but I'm not sure how clean this would be. So far, it looks like we've got Stephan, Sean and Jeremy Buchman who have = volunteered on this project. I'll try and get the schema for Oracle in m= y= next email to you all. This should firm up the datbase design for the = Oracle schema. =20 I'm thinking that by using the PEAR DB library, those wanting to stay with = mysql could just substitute the PEAR DB calls in your unit testing, as you = go. So, whether using PEAR DB in some calls and direct mysql calls in = others, it should work. I've attached oracleIncBeta.php, the Oracle versions for all the mysql = calls I have identified as being used in the phpESP. Most were pretty = straigt-forward to handle. There was one that I'd like to see if we can = dispose of, however. See if you can guess which one it is. =20 Please take a look at these routines (there mysql counterpart would be = mysql_connect for oracleConnect, mysql_close for oracleClose, etc.) and = assist in identfying the PEAR DB function that would take it's place. I'd like to propose we use ORACLE as the test platform. Or at least, I'd = like to see the end product work with Oracle as one of the standard databases. I'll attach the Oracle schema in my next = posting. There are 13 functions. If you would like to sign up for one, please mark = your name or initials next to the routine. Please list the name of the identical PEAR DB fuction, if there is on. If = not please indicate. Mark TESTED with an 'x/ORACLE' to show test complete on Oracle platform. Mark INIT with your initials and then add a date when test complete. ex. = cws. ex. cws-11/18/03=20 =66unction PEAR DB = = TESTED/Platform INIT/Date =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D oracleConnect oracleClose oracleQuery oracleFetchArray oracleNumRows oracleExecuteQuery oracleFetchRow oracleError() oracleFreeResult oracleInsertId oracleResult oracleSelectDB oracleAffectedRows Charlie 11/18/03 Charlie Smith wrote on 10/24/03 10:26AM: <snip> Calling for help - W O U L D A N Y O N E B E INTERESTED = IN ASSISTING WITH THE PORT OF MYSQL TO PEAR DB? If so, please respond, and I'll try and divy out= = assignments. </snip> >>> "Charlie Smith" <Sm...@ld...> 10/06/03 07:28AM >>> So code would be modified to be: if (mystring=3D=3D'') mysql=3D'select * from designer where username is null'; else mysql=3D'select * from designer where username =3D ' + = quotefunc(mystring); See = http://www.tek-tips.com/viewthread.cfm?spid=3D759&newpid=3D759&sqid=3D65748= 0= for further discussion on topic of empty string. >>> "Charlie Smith" <Sm...@ld...> 10/02/03 01:51PM >>> Yes, the use of PEARDB should make the long if's largely unnecessary. =46or field definitions, I'd be inclined to go with NULLs as well. We'd us= e= the NULL and NOT NULL qualifier in the field definitions and work out the = default values in the code. So we'd keep fields defined as NOT NULL in = Oracle. The field definition of fieldname ... NOT NULL default '' is not= = valid in Oracle. Also, in Oracle, NULL fields are detected differently = that fields with data in them when using a select statement. ie. select * = =66rom table where field IS null=20 would be the code for going against the Oracle table rather than select *= = =66rom table where field =3D null (This is an invalid select as you have= = to use 'is' and 'is not' null when detecting null fields in the oracle = tables, not =3D and !=3D. So if there is code in phpESP which references = empty string in select statements, it would need to be modified. I had thought we may want to replace the NOT NULL default '' with just = default ' '. But had my reservations. Thanks for your input on this, = though I confess I am still a bit confused. In Oracle if there is no = supplied value for a nullable field (any field not declared as NOT NULL), = it's value is NULL by default. If you had a choice between default NULL an= d= NOT NULL, which would you want to go with? =20 =46or following fields we could translate to Oracle as follows? MySQL becomes Oracle int(10) unsigned NOT NULL default '0' NOT NULL default NULL, NULL int(10) unsigned default '0' default 0 enum('Y','N') NOT NULL default 'N' NOT NULL (with check constraint= = *) NOT NULL default '' NOT NULL * check constraint syntax: alter table designer add constraint designer_pdesign_ck check (pdesign in ('Y','N')); We could also put a trigger on the table/field so that on insert or update,= = if the new field value were null, it would get populated with 'N'. We = could handle all the other default values this way except for the empty = string ''. We'd have to modify the code for this where it selects from = table where field =3D ''. =46or ENUM types, a check constraint can be used in Oracle, to make sure = values are matched against those we want to allow. What would the syntax look like in PostGres? Does this sound agreeable? >>> "James E. Flemer" <jf...@uv...> 10/01/03 06:43PM >>> Jeremy Buchmann wrote: > On Wednesday, October 1, 2003, at 02:13 PM, Stefan Champailler wrote: >=20 >>> With that: >>> Let's discuss how to handle the schemas >>> 1) ENUM type in PostGreSQL and Oracle. >>> 2) the empty string in default values >>> 3) default values vs NOT NULL >> >> >> My Oracle and PostgreSQL is limited, so I ask the question : are we=20 >> planning >> to make severeal schema with the hope to have minimum code rewrite on the >> phpESP side ? (I guess it makes sense). >> >=20 > I think it's best to work out a schema that: >=20 > 1. Is as generic as possible so we can avoid or minimize code like this: >=20 > if ($DB =3D=3D "mysql") { > do something... > } > elseif ($DB =3D=3D "postgresql") { > do something else... > } > elseif ($DB =3D=3D "oracle") { > etc, etc > } >=20 > 2. Is still functionally the same as the current one (I don't think=20 > anyone wants to get into a database redesign). Let me clarify=20 > that...it's not just functionally the same, it is the same except we may= =20 > change some data types to something more generic and rename some fields=20 > to avoid keyword collisions. >=20 > So it would be the same generic schema for each database, but different=20 > creation scripts and things like that. At least, that's how I envision = it. Please, please avoid huge if/else blocks if possible. (Even if I did=20 not in the past.) I think that PEAR::DB will help avoid this in most=20 cases. By making phpESP database engine independant, use of neat DB=20 =66eatures will likely have to be sacrificed. When it comes down to it,=20 if a suitible ``enum'' type does not exist accross the board (in a way=20 that will be acessible with the same SQL query), then just use a numeric=20 type, and map it to an enumeration only inside the PHP code. If NULL is=20 not available as a default, don't use it, use -1 and remap all internal=20 representation that needs it. I really hope that NULL will be an=20 option, because it is the best way to represent the lack of a value.=20 NULL is especially important in the response data to indicate that the=20 question was left blank. Perhaps, we will have to avoid counting on=20 defaults all together, and explicitly set all fields from the code. If all else fails, and there is someplace where it looks like an if/else=20 is needed, then try to avoid it with OO/polymorphism. This may be a=20 better general approach anyway, with objects representing the database=20 tables. I have consitently found that some of the phpesp data is poorly suited=20 =66or storage in a relational db. This is compounded by the fact that=20 mysql (which was the initial customer reqirement) was much happier with=20 a few tables with lots of records than lots of tables with few records.=20 I believe XML w/ a well desinged schema/dtd (using some unknown sort=20 of storage) would be far better for the representation of the survey=20 data (and could provide multi-lingual support much more redily than the=20 current organization). User/group tables are probably best done with=20 some traditional db or directory (SQL or LDAP). -James ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf=20 _______________________________________________ phpESP-devel mailing list php...@li...=20 https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 ---------------------------------------------------------------------------= --- This message may contain confidential information, and is intended only for= = the use of the individual(s) to whom it is addressed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf=20 _______________________________________________ phpESP-devel mailing list php...@li...=20 https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 ---------------------------------------------------------------------------= --- This message may contain confidential information, and is intended only for= = the use of the individual(s) to whom it is addressed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf=20 _______________________________________________ phpESP-devel mailing list php...@li...=20 https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 ------------------------------------------------------- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=3Dmm/g22lp.tmpl= =20 _______________________________________________ phpESP-devel mailing list php...@li...=20 https://lists.sourceforge.net/lists/listinfo/phpesp-devel=20 ---------------------------------------------------------------------------= --- This message may contain confidential information, and is intended only for= = the use of the individual(s) to whom it is addressed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D |