From: flobee <fl...@gm...> - 2003-05-28 17:02:40
|
maybe it was me, a long time ago! i have lots of surveys but (basicly) alwasy the same forms and questions! (research things) so , copying the survey and the database blows up very huge a shared function or extra table would limit a lot ----- Original Message ----- From: "Chad Bearden" <ch...@be...> To: <php...@li...> Sent: Wednesday, May 28, 2003 6:07 PM Subject: [phpesp-dev] choices from table rather than phpesp:question_choice > I'm looking for any comments you might have on the following: > > I've been toying around with the idea of grabbing choices for questions > from other db tables rather than having to type them into the create > survey interface. I believe someone else came up with the idea but > after searching the message archive I can't quite track who... Anyway, > the idea goes something like this... > > When creating a new question rather than listing choices that may just > be duplication of another table in your database enter a sql query and > have phpESP do the work for you. > > example: let's say you want to list all of the dental clinics for a > respondent to choose from. The question text would be: > > Choose the clinic where you performed the procedures. > > Question Type could be any type with multiple choices: [Radio, Check > Boxes, Drop Down, Rate] > > Now instead of typing all of the clinics and possibly creating errors > along the way. Enter the following special tag and sql. > > On line 1: > <sql>select name from clinic order by name</sql> > > ( if the clinic table wasn't in the phpESP db then enter an optional > argument telling the db name, DB::connect() syntax ) like this: > > On line 1: > <connect> mysql://user:password@machine_address/db_name</connect> > On line 2: > <sql>select clinic_name from clinic order by clinic_name</sql> > > Now, when you clicked [New Field] or [Continue] then the choices would > be created for you! > > Implementation: > > It looks like survey_update() is the only function involved. So, my > idea is to trap multiple choice questions that have the <sql> tags and > create the choices automagically. > > Any comments? > > chad. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application fit in a > relational database is painful, don't do it! Check out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > phpESP-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-devel > |