@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3



Comments:

<0> K_F are the articles on your site store in a mysql db? do you cache them as files or grab them fron the db everytime
<1> alright so I'm trying to set up a web dev environment on my windows box, I've got Apache, PHP, and MySQL all installed, PHP and MySQL are working fine independently but mysql_connect just won't work. Any suggestions on what I could be missing? I'm using localhost and I have created the username and p***word that I'm sending to mysql_connect
<0> errors?
<1> standard mysql_connect(): Can't connect to MySQL server on 'localhost' (10061)
<1> all the tutorials say that it should all just work.
<2> Eldritch: mysql
<0> and question 2?
<2> Eldritch: mysql cache it if requested enough times
<2> it survived 15,000 unique visitors in a day
<2> http://www.kfwebs.net/articles/article/30/Digg+the+aftermath
<2> 4,000 the first hour
<0> hurm ok i think cacheing as files gives you the best of both worlds
<2> mysql> SELECT DATE(clicked) AS dcl,COUNT(1) AS c FROM articles_views GROUP BY article,dcl ORDER BY c DESC LIMIT 1;
<2> | 2006-02-10 | 25825 |
<2> ... the article had 4 pages
<2> | 2006-02-09 | 19463 |



<2> | 2006-02-14 | 2488 |
<1> Is there something I should check to see why PHP and MySQL can't see each other?
<2> the logfiles?
<2> the commandline?
<1> the commandline client works fine.
<2> what do you mean by "can't see eachohter" anyways?
<2> do you even have the mysql module?
<2> <?php phpinfo(); ?>
<2> and that is really a PHP question.
<1> alright, I'll try in the PHP channel then. Thanks.
<2> ... you'll be thrown head first out of it
<0> why + not say - as a word sperator?
<2> but that is another story, you would have here either
<2> Eldritch: no spesific reason actually
<2> http://www.kfwebs.net/articles/article/30/Digg-the-aftermath
<2> look a little cleaner..
<0> im jsut scopeing some work out in my head before i code it
<0> oh an actull mysql question:
<0> poem titles say "The Fish" i would want it sorted as Fish (no the) whats the best way store it as "Fish, The" or something else?
<2> to actually store it as such directly?
<0> it would be a db colum 'title' which would be what i sort by for display
<2> just do it in PHP
<2> $field = (substr($field,0,4)=="The ") ? substr($field, 4).", The" : $field;
<0> thats one option
<2> you can rewrite that to SQL
<2> same logic would apply
<0> yeah i can use trim
<2> no, you can use the exact same logic
<2> it has substr, if, concat ..
<0> select title from foo order by TRIM(leading 'The ' from TRIM(leading "A " from TRIM(leading "An " from TRIM(leading '"' from title))));
<2> and replace..
<0> thats an example i found
<2> yeah, if it is only for the sorting that would do
<0> yes only the sorting
<2> keep in mind that it will slow down the query though
<2> if it happends enough times you would like to have two columns
<2> one for the sorting and one for display
<0> so will doing it with php, i may bench mark it to see which is faster
<2> no, php won't be faster either, better to do as much as possible in the DB
<2> but you would still require an operation on every row
<2> which is slow compared to an own column for it
<0> i think its less than 100 titles so i dont see it being a big deal
<2> how many records are we talking here?
<2> ah, that is nothing
<0> yup should be fine, nice to do it the 'best' way no matter how many, one day i may need to do it for 10 billion :-)
<2> hopefully not, enough poems out there already
<0> well this poet is dead, so she wont be writtign any more
<0> its for nora-may-french.org
<2> ah, that project
<2> I've still never heard of her before
<0> not a suprise at all
<2> Error
<2> Sorry, there has been an error, please fill in the form below and tell me what happened so I can fix it.
<0> shes very obscure
<0> theres only about 5 refrences to her on the web, 3 are from one of my otehr sites
<0> front page error?
<2> yes
<0> bugger - fixing ....
<0> fixed, but i will have to break it again, theres nothing there to see yet anyway
<2> She killed herself by taking cyanide on November the 14th 1907



<2> heh
<2> considered a wiki approach?
<0> or was it an accident - we dont know for sure
<2> and why are you writing about her, is it personal or a job?
<0> i have tried that in the past, getting any one to actully help is an uphill task
<0> personal
<2> yeah, as you said yourself, you have very few sources about her, so it isn't easy to contribute
<0> once i throw on her 100 ish poems a small bio or two that will be it, othnig on-gong to do really
<0> do you know much mod rewite K_F? im having a bad time with something that i know should work
<2> hehe, yeah, I know a thing or two about it
<0> well i'll anoy you with it once i recreat the code i just detleted by mistake
<2> heh
<0> http://www.nora-may-french.org/poems/foo
<0> RewriteRule ^(poems|articles)/([a-zA-z]+)$ $1/index.html?title=$2 [L]
<0> works as expected
<0> but shouldetn i be able to use:
<0> RewriteRule ^(poems|articles)/(*.)$ $1/index.html?title=$2 [L]
<2> huh?
<2> RewriteRule ^(poems|articles)/(.+)$ $1/index.html?title=$2 [L]
<0> sorrry .*
<2> * => zero or more, + => one or more
<0> ok .* and .+ dont work
<2> so the direct "translation" of what you have already is .+
<0> the title is set to index.html in both cases
<2> that doesn't really make sense
<0> well i have:
<0> RewriteRule ^(poems|articles)/(.+)$ $1/index.html?title=$2 [L]
<0> oh it doesent?
<0> um where shall i start?
<2> no, as in, that you get index.html
<0> ahh yes i know but i do
<2> that is your only rewrite rule?
<0> but ([a-zA-z]+) works
<0> yup i remvoed everything else to make sure
<2> make it [L,R=301]
<2> actually make it 302
<2> but still..
<2> http://www.nora-may-french.org/home/noramay/public_html/poems/index.html?title=foo
<0> that sends me here: http://www.nora-may-french.org/home/noramay/public_html/poems/index.html?title=foo
<3> Eldritch: may i ask you how you use rewrite? i cant get it to work at all, i have uncomment mod_rewrite from httpd.conf, then using .htaccess in a sub folder (content: RewriteRule ^foo\.html$ bar.html [R]) but it wont just redirect to bar.html or show the content of that file
<2> read up on AllowOverride
<2> that is an apache configuration question, so read the apache manual
<2> Eldritch: try RewriteBase /
<2> actually ..
<2> RewriteRule ^(poems|articles)/(.+)$ /$1/index.html?title=$2 [L]
<2> what does that do?
<0> 500 error
<2> RewriteBase /
<2> RewriteRule ^(poems|articles)/(.+)$ /$1/index.html?title=$2 [L,R=302]
<0> "The page isn't redirecting properly"
<0> ff error, proberbly going in circles
<2> which version of Apache is it?
<2> arrgh bah
<2> of course
<2> duh
<2> move the damn index.html out of the root itself
<2> RewriteRule ^(poems|articles)/(.+)$ /poems.html?title=$2 [L]
<2> ..... duh
<2> sometimes the answer is too obvious to consider
<2> or add this above
<2> RewriteCond %{REQUEST_URI} ! index\.html
<0> yeah
<0> darn i have done that before
<0> why dident i rember that
<2> more importantly, why didn't I think of it
<0> i still kind of want it in the poerty dir but "RewriteCond %{REQUEST_URI} ! index\.php" doeset seem to want to work
<2> uhm
<2> .html
<2> damn you for using non-standard extensions
<0> yeah i renamed the file to index.php
<0> lol all my html files go through the php parser
<2> <2> RewriteRule ^(poems|articles)/(.+)$ /poems.html?title=$2 [L]


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #mysql
or
Go to some related logs:

90mm turbos
yay ya coco jumbo
#linux
#windows
Pastizz
#MissKitten
#linuxhelp
example jmicropolygon
#linuxhelp
#windows



Home  |  disclaimer  |  contact  |  submit quotes