Re: [PHP] Re: echo?
2011/3/23 Jim Giner : > ok - here's the code in question. > $q = 'select * from director_records '; > $qrslt = mysql_query($q); > $rows = mysql_num_rows($qrslt); > for ($i=0; $i<$rows; $i++) > { > $j = $i+1; > $row = mysql_fetch_array($qrslt); > echo $j.'-'.$row['userid']; > if ($row['user_priv']<> "") try > echo ' ('.$row['user_priv'].") \r\n"; //If you don't put \r\n or a space at the end of the echo then the beginning on the next line is going to be interpreted as #101/#102/#103 aso (that i figured when you wrote that putting a space in the beginning of the echo solved the problem. > else echo " \r\n"; > } -- ** Hans Åhlin Tel: +46761488019 icq: 275232967 http://www.kronan-net.com/ irc://irc.freenode.net:6667 - TheCoin ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: echo?
On Mar 22, 2011, at 9:50 PM, Jim Giner wrote: Yes - it is J and I. I tried using $i+1 in the echo originally but it wouldn't run. That's why I created $j. Interesting it wouldn't run.. perhaps that's a place to investigate? And just what is wrong with the old cr/lf sequence? How would you have done it? If it is being sent to a browser, which i suspect given the html entities encoding, i would have used "". If it is being sent to a terminal or file, I would have used "\n". What do you mean 'this alone .'? Merely that the construction I see shouldn't matter whether you use $j or $i+1. "Tamara Temple" wrote in message news:521bdb9d-adbf-45d7-b759-acd315b19...@gmail.com... On Mar 22, 2011, at 8:42 PM, Jim Giner wrote: ok - here's the code in question. $q = 'select * from director_records '; $qrslt = mysql_query($q); $rows = mysql_num_rows($qrslt); for ($i=0; $i<$rows; $i++) { $j = $i+1; Am i reading this correctly: the first variable is j (jay) the second variable is i (eye) ? This alone doesn't explain anything... $row = mysql_fetch_array($qrslt); echo $j.'-'.$row['userid']; Since this is the only place $j is used, try subbing in $i+1 and see what you get. if ($row['user_priv']<> "") echo ' ('.$row['user_priv'].') '; This is really rather a strange way of getting a line break. else echo ' '; } The output I get is: 1-smith5 f-ginerjm (M) g-smith8 While the alpha parts are valid, the index is only correct for the first one (0) obviously. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Slow sessions.
I have a load balanced website with 5 web servers. Currently, they run php 5.1.4 (for pdflib reasons). I'm going to upgrade them, so I removed one from the load balancer and installed php 5.2.17 on it. I originally installed 5.3, but some of the code was causing problems, so I went back to the latest version of 5.2. The problem I'm having is that the session_start() call consistently takes about 30 seconds to run. If I create a file that just has a session_start call in it and nothing else, it takes about thirty seconds. I've tried a bunch of different things, and can't figure out what the problem is. I've created a file that grabs the session cookie, opens the session file (fopen), reads it, writes to it, and closes it, and that file runs in less than 1/10 of a second. It doesn't seem to be a file locking issue. I've searched for a solution, and so far I haven't found one. The common work-around is to write a user session management system, which I would do if I could, but with the load balanced environment, I kind of need to keep the current system in place. Any suggestions would be appreciated. I've run out of my own options to try. Thanks. -- Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload Progress Meter
Brad Broerman wrote: Essentially, they all require Flash or Java... You are generally talking about two different sides of the client/server relationship.. unless you are talking about Applets, right?... so I have an issue with the statement. If jquery does one (as mentioned), it's likely not Flash nor Java. I'm not trying to be an arse or anything, but I don't see it being that limiting. I do think it's difficult to recommend a progress meter when there is not a lot of info given of what is being metered. If you need to meter the processes for javascript, then you'd likely use javascript, if you need to meter a server-side intensive task, then you could use a server-side method, or a combination of things. It all comes down to a pretty graphic to watch while your waiting for a task to finish. ;-) Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Upload Progress Meter
Essentially, they all require Flash or Java... Most use Flash... If you want one that is in Java, and is scriptable in JavaScript, I have one on my website: http://www.bbroerman.net/code.html -Brad -Original Message- From: Floyd Resler [mailto:fres...@adex-intl.com] Sent: Wednesday, March 23, 2011 10:29 AM To: sstap...@mnsi.net Cc: PHP Subject: Re: [PHP] Upload Progress Meter On Mar 23, 2011, at 10:10 AM, Steve Staples wrote: > On Wed, 2011-03-23 at 09:59 -0400, Floyd Resler wrote: >> I am in need of an upload progress meter. I've seen plenty of tutorials = >> on-line requiring installing modules, hooks, patches, etc. However, my = >> Wordpress install accomplished this without me having to make any = >> modifications to my PHP install. So, how is it done? >> >> Thanks! >> Floyd >> > > you can google this... > > "jquery upload progress meter" > > or: > http://www.nixboxdesigns.com/demos/jquery-uploadprogress.php > > http://www.bitrepository.com/uploading-files-with-progress-bar.html > > > > Steve > I'll check it out! Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php