02-08-2011, 05:12 PM | #1 |
Truth or Dare Enthusiast
Join Date: Oct 2009
Posts: 2,522
|
Advice Wanted: Creating a Random Database
*
Problem solved; thank you to everyone for their quick and clever answers! * Okay so I'm making a Thing and it'll have a whole bunch of entries, then I want it so that I can basically just click something and it'll retrieve one of those entries at random. I want this to be: [list][*]Relatively simple[*]Private[*]Easy for me to access (i.e. not taking three hours to get a random thing chosen)[*]Easy to add more entries to I know how to do this in Flash, but that wouldn't really be easy to add new entries to. I could also just number them and get a number from random.org, but that would be annoying. I don't know anything about programming really, so no C++ etc. I can use Flash, any Office app, anything online. Any assistance is much appreciated. Last edited by Leopard; 02-08-2011 at 05:53 PM. |
02-08-2011, 05:17 PM | #2 |
getDare Sweetheart
Join Date: May 2010
Location: CA
Posts: 291
|
javascript would make things rather easy
there is a neat function VAR.push("text"); that lets you ad a new entry to an array quickly. then you can use a standard random number puller script. You just need somewhere to host the script Last edited by OneMoreTime; 02-08-2011 at 05:26 PM. |
02-08-2011, 05:22 PM | #3 |
Senior Member
Join Date: Dec 2010
Location: Australia
Posts: 146
|
A couple of things to know.
Is this going to be published online? Do you mind using database at all? I'm thinking of creating a simple webpage when you can enter entries and randomly pick them out (using PHP). |
02-08-2011, 05:24 PM | #4 |
Truth or Dare Enthusiast
Join Date: Oct 2009
Posts: 2,522
|
In this instance it's going to be entirely private, so probably not online.
Database things are fine assuming it's something I can set up reasonably easily (i.e. if someone just gives me the basic example for 1-2 entries and I add however in manually myself.) I'd need to install some sort of PHP server to use it on my own computer, wouldn't I? I'm pretty good with software in general, just not a programmer or web developer, so while I can figure things out when I have something to start with, no good at building it from scratch. |
02-08-2011, 05:28 PM | #5 |
Member
Join Date: May 2010
Location: Online (Europe)
Posts: 99
|
The simpliest solution would be to do it in MS Excel. A bit harder, but still easier than configuring Apache or IIS would be MS Access. You can PM me for tips.
__________________
29F+29M Likes: HER: orgasms, light pain, bondage, sex, roleplay, spanking, no-risk humiliation HIS: the same from dominant side Dislikes: HER: pee (giving), wax HIS: pee (receiving), wax, anal BOTH: ice Limits: BOTH: no to strangers, too public, crossdressing, heavy pain, poo, permanent, blood, wedgie, own pee, dangerous HER: pee receiving Ask HER: http://www.getdare.com/bbs/showthread.php?t=132082 |
02-08-2011, 05:29 PM | #6 |
getDare Sweetheart
Join Date: May 2010
Location: CA
Posts: 291
|
I can hack together a normal html page with javascript plugged in. take all of 20 seconds lol.
|
02-08-2011, 05:30 PM | #7 |
Truth or Dare Enthusiast
Join Date: Oct 2009
Posts: 2,522
|
|
02-08-2011, 05:33 PM | #8 |
Senior Member
Join Date: Dec 2010
Location: Australia
Posts: 146
|
Simplest thing I can think of is, Microsoft Access, if you're running on Windows.
Or, just like OneMoreTime says, Javascript could be a good one too.. It can be run locally on your computer, without the need for hosting or database. I can give give you a sample, but need to wait another 6 hours - after I finish work ;p |
02-08-2011, 05:37 PM | #9 |
getDare Sweetheart
Join Date: May 2010
Location: CA
Posts: 291
|
thinking more, javascript cant actually write to a file. So entries would have to be entered manually in the the file, but they could be retrieved just fine.
|
02-08-2011, 05:40 PM | #10 |
Member
Join Date: Feb 2009
Location: Canada
Posts: 35
|
This has been tested in a Google Docs spreadsheet, but may also work in Excel (though I promise nothing).
You can refresh the random choice with Ctrl-R. |
02-08-2011, 05:43 PM | #11 | |
Truth or Dare Enthusiast
Join Date: Oct 2009
Posts: 2,522
|
Quote:
Wise; Thanks a lot, will check that out. Though a html file would be ideal for me, I think. |
|
02-08-2011, 05:45 PM | #12 |
getDare Sweetheart
Join Date: May 2010
Location: CA
Posts: 291
|
HTML Code:
<script type="text/javascript"> /** Simply add the following to the code to make either new truths or dares dare.push("blah"); truth.push("blah"); **/ var dare = new Array(); dare.push("dare 1"); dare.push("dare 2"); var truth = new Array(); truth.push('truth 1'); truth.push('truth 2'); function rotate_dare() { var i = Math.floor(Math.random()*dare.length); document.getElementById('dare_content').innerHTML = dare[i]; document.getElementById('dice_roll').innerHTML = ''; } function rotate_truth() { var i= Math.floor(Math.random()*truth.length); document.getElementById('dare_content').innerHTML = truth[i]; document.getElementById('dice_roll').innerHTML = ''; } </script> <table cellpadding="5" cellspacing="3" align="center" style="background-color:#EDE685"> <tr> <td colspan="2" align="center" width="500" style="font-family:Times New Roman;"><b>Truth or Dare?</b></td> </tr> <tr> <td align="center"><input type="button" value="Truth" border="0" onclick="javascript:rotate_truth()" /></td> <td align="center"><input type="button" value="Dare" border="0" onclick="javascript:rotate_dare()" /></td> </tr> <tr> <td id="dare_content" colspan="2" width="500" align="center">Go ahead, ask for a truth ... I dare you!</td> </tr> </table> |
02-08-2011, 05:48 PM | #13 | |
Truth or Dare Enthusiast
Join Date: Oct 2009
Posts: 2,522
|
Quote:
So I simply add dare.push('dare 3 is this') right? Are there any characters I can't use, " [ ] () etc? |
|
02-08-2011, 05:52 PM | #14 | |
getDare Sweetheart
Join Date: May 2010
Location: CA
Posts: 291
|
Quote:
EDIT: also just realized i used " for one group and ' for the other lol. best to use the same one for both |
|
02-08-2011, 05:53 PM | #15 |
Truth or Dare Enthusiast
Join Date: Oct 2009
Posts: 2,522
|
Okay, thank you very much, that's exactly what I wanted
|
Advertisements |
|
|