From: David L. <lio...@co...> - 2005-03-09 19:58:17
|
One of my students accidentally archived a survey, and now cannot access the results. Is there a way to retrieve them -- even in comma-delimited form? Dave |
From: Brian W. <br...@be...> - 2005-03-09 20:24:48
|
David, You can often find your answer by searching the mailing list archive (linked from the phpESP homepage). http://sourceforge.net/mailarchive/message.php?msg_id=5559358 The SQL would be: update survey set status = 1 where id='[id]' [id] is the id number of the survey. Be really careful running update sql statements. if you get the Where clause wrong you can overwrite data. Brian Wood Programmer/Analyst UC Berkeley Human Resources David Liontooth wrote: > One of my students accidentally archived a survey, and now cannot > access the results. > Is there a way to retrieve them -- even in comma-delimited form? > > Dave > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > phpESP-general mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-general |
From: David L. <lio...@co...> - 2005-03-10 02:13:39
|
Hi Brian, Thank you for the instructions. Brian Wood wrote: > David, > > You can often find your answer by searching the mailing list archive > (linked from the phpESP homepage). > > http://sourceforge.net/mailarchive/message.php?msg_id=5559358 This is good, but the line below is the real goods. I was able to change the status successfully, to the immense relief of my student. The status of the survey when I looked in the database was 15, and I changed it to 1. I'll post the steps for reference. Best, Dave > > The SQL would be: > > update survey set status = 1 where id='[id]' > > [id] is the id number of the survey. > > Be really careful running update sql statements. if you get the Where > clause wrong you can overwrite data. > > Brian Wood > Programmer/Analyst > UC Berkeley Human Resources > > > > David Liontooth wrote: > >> One of my students accidentally archived a survey, and now cannot >> access the results. >> Is there a way to retrieve them -- even in comma-delimited form? >> >> Dave >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >> _______________________________________________ >> phpESP-general mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpesp-general > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > phpESP-general mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-general |
From: David L. <lio...@co...> - 2005-03-10 03:14:52
|
When you archive a survey in phpESP, the survey is removed from view and the results become inaccessible. The following is what you can do to reinstate an archived survey -- it's submitted here for the record. In brief, you need to go into the mysql database that phpESP uses and reset the status of the archived survey. 1. First you need to locate the ID of the survey -- the number assigned consequtively to each new survey. If you already have this information, you can skip this step. To locate the ID, issue mysql -e 'select * from survey order by changed desc limit 5' phpesp | more This asks for a listing, in descending order, of the latest changes made to the fields in the survey table. Set the limit to ensure your archived survey is included; you can use a range such as 10,15. The status field of the archived survey in my case was set to 15; an active survey has status 1. 2. Second, to be on the safe side, you may want to backup your table of surveys, in case something goes wrong: mysqldump phpesp survey > survey-table-backup-2005-03-09.txt If you need to recreate the survey table, you have the data in this file. 3. Third, take out the knife and perform a slight incision and surgical manipulation as follows: mysql -e 'update survey set status = 1 where id=101' phpesp The number -- in this example 101 -- is the ID of your survey, determined in step 1 above. That's all there's to it. The archived survey is now reactivated, and the results are again available. Dave P.S. In order to use "mysql -e" and "mysqldump" commands in this manner, you need to have your user name and password entered in a file called ~/.my.cnf. Alternatively you can add "-u root -p" to the commands and enter the password manually: mysql -u root -p -e 'select * from survey order by changed desc limit 5' phpesp Finally, changing the status of a survey is likely also possible from phpmyadmin, a web interface to your mysql databases; I've just installed it and not played around with it much, but it has a very user-friendly interface. |