Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#php

09 November 2007


Total 42 pages. You are browsing page 1/42.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last

--- Log opened Fri Nov 09 00:00:22 2007
--- Day changed Fri Nov 09 2007
00:00 <****> when you use LIMIT on on sql query, is there a way to determine how many actually matched?
00:00 <****> AustLaw`: um ... that's what limit does.
00:00 <****> mysql_fetch_array returns a numeric key value right?
00:00 <****> auto incremented?
00:00 <****> starting from 0?/
00:01 <****> what do you mean thats what limit does?
00:01 <****> AustLaw`: oh, sorry, I misread. No, there's not.
00:01 <****> for example, if I do a query that matches 5000 results. I was to say somthing like, "showing 1-30 of 5000"
00:01 <****> AustLaw`: you can run a count() query first though
00:01 <****> not again
00:02 <****> hmm and run the query twice?
00:02 <****> PaulB: What are you asking?
00:02 <****> AustLaw`: yep.
00:02 <****> thats how all the sites do it? :\
00:03 <****> PerlJam: i'm asking does mysql fetcha rray retunr an incremented key value for your array
00:03 <****> PaulB: it returns an array for all of the columns in your query. I'm not sure what you're trying to get at with "incremented"
00:04 <****> AustLaw`: What's wrong with running the query twice?
00:04 <****> I have a trojen on my iis server that edits all of my php files and inserts a php script that when seen in a browers pops up as being a trojen called "small.bot"
00:04 <****> nite
00:04 <****> Just upgraded to latest version of php. every heard of this one?
00:05 <****> i got a bad something on my server once
00:05 <****> that inserted adverts all over my pages :p
00:05 <****> someone help :D
00:05 <****> I guess it seems inefficient, maybe not
00:05 <****> never founda fix =\
00:06 <****> umm
00:07 <****> Is there anyway to set a mySQL variable and also have a UPDATE in a single mysql query command?
00:08 <****> or any workarounds for this?
00:08 <****> $value)" I get an invalid argument error What am I doing wrong? any suggestions?
00:09 <****> Session variables are maintained until the session expires, right?
00:09 <****> yes
00:10 <****> is $myarray[85] an array, or an element of an array?
00:10 <****> i don't believe you can, but ask in #mysql
00:10 <****> Do I still need to call session_start()?
00:10 <****> Ok. Hmm, is there any way to ensure that the same user will get the same persistent mysql connection?
00:11 <****> I don't think your supposed to have a persistant mysql connection per user, i was under the impression it was more of a per-server thing
00:11 <****> might be wrong tho
00:12 <****> Well, from what I read, if I use a mysql_pconnect, it starts a persistent connection on the server, however, if two users both open persistent connections, there is no guarantee that user 1 will always get the connection that he/she initiated
00:13 <****> That was kind of like watching lemmings run off a cliff.
00:14 <****> $myarray). My question before was what to do now. I can print_r that $myarray and see all the categoryid and productid(s) but I don't know ho
00:14 <****> w to cycle through giving a certain key. That might have just made things more complicated. Let me know
00:14 <****> seems FOUND_ROWS() is the mysql statement I was looking for, without having to run the query a second time
00:15 <****> SQL_CALC_FOUND_ROWS <--
00:15 <****> dot forget that
00:16 <****> maestrojed, i would have thought that how you showed about would do it
00:17 <****> how do I add 3 days to the current date ?
00:17 <****> strtotime('+3 days');
00:17 <****> or time()+3*86400;
00:17 <****> thanks ! :D
00:18 <****> Patabugen: me too :)
00:19 <****> how do i select from an array much like select from a mysql array
00:19 <****> i want to select the key value where key value = foo
00:19 <****> $array['foo']
00:19 <****> err, array_search()
00:20 <****> you can't select "like sql"
00:20 <****> f
00:20 <****> what kind of time format is
00:20 <****> 2007-10-25T12:58:19-07:00
00:21 <****> carcrash: looks like ISO with timezone, but not sure :)
00:22 <****> $value)
00:22 <****> carcrash: http://www.w3.org/TR/NOTE-datetime
00:27 <****> ok here is my issue, i have a table of team rankings, there are 1000 teams, when the user goes to check the rankings, I want the user to one see a list of the top 5, if they are in that top 5...then it will be normal, if they are not in the top 5, i want to show the top5 and then show them at the bottom with their rank
00:27 <****> i don't have a rank column however, i just sort by point totals
00:27 <****> so 1. how would i be able to get that rank number
00:27 <****> Do I need to call session_start at the beginning of every php page, or is it maintained automatically?
00:27 <****> froderick: yes
00:28 <****> you need to
00:28 <****> PaulB: I suggest to add that column :)
00:28 <****> Naktibalda: why is that
00:28 <****> can' t i get the number from the key value?
00:28 <****> it is fastest way
00:28 <****> is there another way?
00:29 <****> '$user_points'
00:30 <****> (SELECT points FROM table WHERE user_id = '$user_id')
00:30 <****> :)
00:30 <****> PaulB: you can ORDER BY calcuations
00:30 <****> e.g. SELECT (somepoints * 2 / someotherpoints
00:30 <****> ) AS rank FROM foo ORDER BY rank
00:30 <****> ok thanks guys
00:31 <****> Hmm, note to self: start apache before trying to load pages
00:34 <****> Hmm, now what's the best way to destroy the session if it spans multiple pages?
00:34 <****> Should I just put a "logout" link on each page and have it execute session_destroy()?
00:35 <****> froderick, depends, sometimes people store non sensitive info other than authentication info in Sessions
00:35 <****> using session_destroy would destroy everything
00:36 <****> $array1 + $array2 =)
00:36 <****> sometimes all that is needed is to unset the session variable that is being checked for authentication
00:36 <****> can i add such stuff to a class ?
00:37 <****> cyth: the only session variable I'm storing is the IP address. Is there any particular reason I shouldn't call session_destroy() in that case?
00:37 <****> Does session_destroy() release anything other than session variables, or is it just a convenient "kill everything" function?
00:37 <****> Has anybody here worked with SWFUpload before?
00:37 <****> froderick, that's in the documentation
00:38 <****> You're right, I actually found that right as I asked it :p
00:38 <****> sorry
00:38 <****> rocketmagnet: unfortunately not
00:41 <****> *sniff*
00:41 <****> what with interfaces ?
00:41 <****> because the array object support it
00:42 <****> what if i extend the array object ?


Total 42 pages. You are browsing page 1/42.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo