@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info


Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33



Comments:

<Edward123> well, that'll do
<absentia> what do you want/need?
<Edward123> trying to find out what 0D0A is so i can remove it from a str
<Mosselmaniac> hi guys
<Mosselmaniac> i loop through a result from mysql, just like alwaays with while ($array=mysql_fetch_array($result))
<Edward123> turns out it's CR LF - that's \n\r in PHP, right?
<Mosselmaniac> but i want to access information from the NEXT $array that is created
<Mosselmaniac> is that possible?
<Dangermouse> Edward123: yes, in double quotes
<absentia> man, after a while, you'll know those codes by eart.
<SkramX> Hi All
<SkramX> $query = "SELECT `value` FROM `setting` WHERE id=80";
<SkramX> $result=mysql_query($query) or die ("Unable to query");
<Edward123> Mosselmaniac... not entirely sure i understand your question, but could you loop through the array afterwards?
<SkramX> how do i echo the $result
<Dangermouse> I knew it was 10 and 13 but i didnt remember what ascii code it was :P
<kon> SkramX: this is a ressource, you need to fetch the rows first
<Mosselmaniac> hmm edward
<Edward123> SkramX: look up mysql_fetch_Array
<Dangermouse> character*
<Mosselmaniac> let me explain
<SkramX> kon: eh?
<SkramX> Edward123: uhmm....
<kon> SkramX: php.net
<absentia> anyone have an answer or sugestion for my question?
<Mosselmaniac> i loop through select * from a, then i get the field 'b' from the table a. i want to compare 'b' to the 'b' i get from the next iteration. but i want to compare it THEN, not after the next iteration.Somebody understand me? I hope there is a solution
<Edward123> i'm stupid today
<Mosselmaniac> can i go back in the result?
<Edward123> i can't figure out how line breaks are still in $output: http://pastebin.com/574891
<Mosselmaniac> then i can just do another $array=mysql_fetch_array($result) and compare it, and go back. or not?
<absentia> can you write php as a cgi that DOESN'T automatically do the GET/POST?
<TML> Mosselmaniac: while($row = mysql_fetch_array($result)) { $rows[] = $row; }
<Edward123> heh
<Edward123> 3 questions
<Edward123> no answers
<Mosselmaniac> what does that do, tml?
<absentia> I need to be able to parse the http myself... do I have to use a language like perl ?
<TML> Mosselmaniac: Makes an array that has the entire dataset
<Mosselmaniac> i don't want that i guess
<TML> absentia: You need to not use an HTTP server if you want to process the HTTP yourself.
<TML> Mosselmaniac: It's the only way to do what you're asking.
<Mosselmaniac> serious?
<TML> Serious
<Mosselmaniac> can't i just go forward, and go backward ?
<TML> No.
<absentia> TMP: I mean, I want to read from stdin and get the post data ... in perl you do that just by reading stdin, but in php, it tends to want to slurp the get/post stuff... is there any way to disable that?
<Edward123> Mosselmaniac: although if you want to have a play around with it check out mysql_data_seek()
<kon> well, in the array you can then
<absentia> I need to hanel 20 MB uploads, and I want to be able to give feedback along the way by reading a buffer chunk and responding, etc.
<Edward123> you can mess around with the pointer then
<Mosselmaniac> tml,maybe you know another solution
<Edward123> but i think a 2d away is what you need
<absentia> I'm at the point where I may need to write perl wrappers to call php... whih is unfortunate.
<Mosselmaniac> i want to output an image, UNLESS the value of 'b' is different then the next value of 'b'
<Edward123> can anyone figure out how newlines are surviving this process at all? http://pastebin.com/574891
<TML> Mosselmaniac: As Edward123 says, there is a very limited amount of control available using mysql_data_seek(), but if you want to jump to arbitrary points in the result set without having to remember the state, use an array.
<TML> absentia: I'm confused why you would think you can do it in perl but not in PHP.
<Mosselmaniac> it's so strange, why can you go forward, but not backwards ?
<absentia> well, perl doesn't automatically do the POST/GET .. php seems to automatically do this
<absentia> I want to be able to tell php NOT to do this.
<kon> Mosselmaniac: something like, if($arr[$i]!=$arr[$i-1]){ //do teh stuff}
<TML> absentia: That's not true. Perl can do it just as automatically as PHP does.
<SkramX> how do i take a variable, and only print lines 1 thru 10 of the output
<absentia> er
<Mosselmaniac> kon, exactly
<absentia> tml, please go the other way.
<absentia> I need php NOT to do it.
<TML> absentia: I understand that.
<TML> absentia: What I'm trying to do is get you to stop thinking of them as so different.
<absentia> I'm not talking about having perl load in a module and then do it "automatically" ... php does it withou ANY calls... without ANY modules.
<Edward123> is there some function that converts output to HEX values?
<absentia> they are different, one seems to be automatic, the other isn't.
<Mosselmaniac> but kon
<killer-instinct> can I store an array in a session?
<TML> absentia: Pretend that PHP preloads the module for you
<SkramX> how do i take a variable, and only print lines 1 thru 10 of the output
<Mosselmaniac> kon
<absentia> tml: agreed... now I want to tell php to FO and *not* preload that module.
<Mosselmaniac> $array=mysql_fetch_array($result)
<TML> absentia: ***ume PHP is just like perl in this aspect (because it really is). How would you solve it in perl?
<Mosselmaniac> i fill my array using this
<Mosselmaniac> can't i do
<absentia> file.cgi, read stdin.
<nitroxide> yo
<Mosselmaniac> hmmf i don't know it anymore :(
<TML> absentia: So, my question is, why would you ***ume it's any different in PHP?
<kon> Mosselmaniac :(
<auroraeosrose> absentia: you're talking about upload feedback.... php doesn't have that yet - there is a patch that's been sitting around if you're brave http://pdoru.from.ro/
<nitroxide> is there a way to get with php the information provided by apache when there is a client X509 auth ?
<TML> auroraeosrose: Stop. You're wrong, and you're confusing the issue.
<Mosselmaniac> listen, $array=mysql_fetch_array($result) goes through my mysql result, right?
<TML> absentia: Ignore what auroraeosrose just said.
<absentia> au: naw, if you can have PHP *not* automagically slurp the get/post -- you can do that yourself... so far, no one seems to know if this is possible.
<TML> Mosselmaniac: correct
<TML> absentia: *I* know it's possible
<Mosselmaniac> now i get $array['b'] from it. now i want to check if $array['b'] is different then the $array['b'] from the NEXT one i get
<absentia> how do you do it ?
<TML> absentia: How do you do it in perl?
<absentia> plase just tell me and put me out of my misery, please?
<absentia> just read from stdin
<niraj> lol
<TML> absentia: So why do you think it's any different in PHP??!!?
<kon> stdin://
<absentia> because php seems to process the stuff without me doing any calls!
<absentia> god, are we jsut going in crcles?
<TML> absentia: Ignore what you THINK is going on and listen to what I'm saying.
<absentia> you say it's the same
<TML> 06:50 < TML> absentia: ***ume PHP is just like perl in this aspect (because it really is). How would you solve it in perl?
<TML> absentia: Correct
<Mosselmaniac> now i get $array['b'] from it. now i want to check if $array['b'] is different then the $array['b'] from the NEXT one i get? Then i really need to do the complex way TML told me? Tml?
<absentia> why not say somthing like: if you post to a php page and php is invoked with <?php -- no, you can not stop it.. if you call php like a cgi and the fisrt line in #!/path/to/php -- thenit will work like you expect
<TML> Mosselmaniac: You need to fetch the next one to check a value of it.
<absentia> instead of teasing me
<absentia> you're telling me it will work -- but not telling me HOW to get it to work
<absentia> it's extremely infuriating
<Mosselmaniac> tml; exactly.
<Mosselmaniac> so how would i do that?
<TML> absentia: If you post to a PHP page and PHP is invoked with <?php, you can read from STDIN and it will behave exactly the same as perl would.
<TML> Mosselmaniac: The same way you fetched THIS one.
<Mosselmaniac> just another $array2=mysql_fetch_array($result) ?
<absentia> really?
<TML> absentia: REALLY!
<kon> Mosselmaniac: add each array to a parent array $arrData[] = $array;
<absentia> ow does php know now to do the file upload? etc?
<absentia> then I'm confised how php knows not to do the processing?
<absentia> is it.. magic? or psychic?
<TML> absentia: It doesn't know not to do it. You do both.
<absentia> do both?
<TML> absentia: PHP still processes the request like normal, but you have access to the raw POST data by reading php://stdin.
<Edward123> anyone know if there's a way to use "s in a CSV without screwing up the format?
<absentia> tml: ah, I can't do that.
<Mosselmaniac> kon, i don't understand.
<TML> absentia: Why? You just ignore the other stuff, and read from stdin
<absentia> I need php NOT to process....
<TML> absentia: Just like perl would
<kon> Mosselmaniac: you have to poulate an array which hold all fetched arrays
<kon> populate
<JaredCE> http://pastebin.com/574907 i'm having trouble with my arrays here
<TML> absentia: The problem is that it's not really PHP in either cases that's doing said processing. Before you get to either PHP or Perl, apache has already handled the POST data. All you can do at that point is decide how you interact with it.
<Mosselmaniac> so i put in $arrData[] = $array;?
<TML> absentia: Unless you're proposing to write your own httpd...
<absentia> huh?
<absentia> that's just not true.
<Jeewhizz> TML:, you can access the POST data directly,
<TML> absentia: Sure it is
<TML> Jeewhizz: That's what I just said.
<Jeewhizz> file_get_contents("php://input");
<absentia> you're saying that if I upload to apache
<TML> Jeewhizz: But not before Apache has touched it.
<absentia> it puts my uploads into /tmp?
<Jeewhizz> that gives you the raw POST data


Name:

Comments:

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






Return to #php
or
Go to some related logs:

#lisp
revdep-rebuild command not found
ubuntu bitdefender libfn
#fluxbox
getElementById + w3school
#sendmail
#python
xmlrpclib segfault
#web
ubuntu hotkey workspace



Home  |  disclaimer  |  contact  |  submit quotes