Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 23rd, 2005, 2:20 AM   #1
aquanius
Newbie
 
Join Date: Feb 2005
Posts: 8
Rep Power: 0 aquanius is on a distinguished road
Quote Database

how would you go about doing one? with + and - value increaser like on bash.org

#quote number + - del
QUOTE HERE

like that, and how to do a top 100, random

without using mysql.
aquanius is offline   Reply With Quote
Old Feb 23rd, 2005, 12:00 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Why can't you use MySQL or some other database? It'll make it soooooooooooo much easier.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 23rd, 2005, 12:06 PM   #3
aquanius
Newbie
 
Join Date: Feb 2005
Posts: 8
Rep Power: 0 aquanius is on a distinguished road
my host does not have it.
aquanius is offline   Reply With Quote
Old Feb 23rd, 2005, 12:13 PM   #4
Ade
Hobbyist Programmer
 
Ade's Avatar
 
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0 Ade is an unknown quantity at this point
which database does your host allow?
__________________
Don't wound what you can't kill
Ade is offline   Reply With Quote
Old Feb 23rd, 2005, 12:16 PM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
In that case, I suggest getting a host which does. If that's not an option, you can have a PHP file with an array of quotes, and use the rand() function to pick them randomly.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 23rd, 2005, 2:00 PM   #6
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 6 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Put them all in a file, putting each quote on a new line...

[php]
function getQuote($file) {
$file = implode("", file($file));
$file = explode("\n", $file);
$quoteNum = rand(0, count($file) -1);
return array("number" = >$quoteNum + 1, "quote" => $file[$quoteNum]);
}
[/php]

Example usage:
[php]
$newQuote = getQuote("yourQuotesFile.txt");
echo "Quote #{$newQuote['number']}:<br>\n";
echo "<ul>";
echo $newQuote["quote"];
echo "</ul>";
[/php]
__________________


Last edited by tempest; Feb 23rd, 2005 at 2:04 PM.
tempest is offline   Reply With Quote
Old Feb 23rd, 2005, 2:04 PM   #7
aquanius
Newbie
 
Join Date: Feb 2005
Posts: 8
Rep Power: 0 aquanius is on a distinguished road
my host sucks, no mysql, and I don't really feel like changing.

waht I really need to know is how to do a top 100 and make the + and - and x work.
aquanius is offline   Reply With Quote
Old Feb 24th, 2005, 3:24 PM   #8
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
You probably need to get a new host, might I suggest http://www.crd-hosting.com - they have mySQL and PHP support and plenty of other goodies at very affordable prices
__________________
Clifford Matthew Roche &lt;geek@cliffordroche.com&gt;
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Feb 25th, 2005, 4:54 AM   #9
Ade
Hobbyist Programmer
 
Ade's Avatar
 
Join Date: Oct 2004
Location: England, UK
Posts: 139
Rep Power: 0 Ade is an unknown quantity at this point
Quote:
Originally Posted by aquanius
my host sucks, no mysql, and I don't really feel like changing.
Sounds like the American opinion at vote time

My President sucks, no intelligence, and I don't really feel like changing.
__________________
Don't wound what you can't kill
Ade is offline   Reply With Quote
Old Feb 25th, 2005, 7:42 PM   #10
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Oooh... you're gonna get beats for that one... :p
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:45 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC