| |
| |
| |
|
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
Comments:
<0> TML: that doesn't work.. it outputs Array four times.. and thanks forgot about range.. <1> likewhoa: That doesn't output anything, but if you output $result[1], you'll see it has a value. <1> likewhoa: If you output $result, it'll just output "Array" <2> anyone know if there is an easy equivalent to pg_fetch_all() where the arrays are indexed by number rather than column name? (like the difference between pg_fetch_row() and pg_fetch_***oc() ) <0> yea but i want the variable to be just $b1 not $b[1] for usage outside the foreach.. <1> likewhoa: Why? <1> likewhoa: That's a bad idea. It should be an array. <3> hi people <4> Any idea why this php CLI script doesn:t work? http://pastebin.com/535029 i get an error that says something like ": bad interpreter: there is no file or directory like this" <1> $b1 and $b2 have no relationship. $b[1] and $b[2] do, they're part of the same array. <0> TML: well i was gonna use those variables on something else.. <1> emostar: Your PHP probably isn't stored in /usr/local/bin/php <2> likewhoa: you can't use $b[1] else where? <0> TML: i don't want $b1 $b2 to relate since they both have unique id numbers <4> TML: [jon@bart SystemScripts]$ which php
<4> /usr/local/bin/php <1> emostar: /usr/local/bin/php -i <1> emostar: Does that output PHP configuration data? <4> TML: yeah <4> [jon@bart SystemScripts]$ /usr/local/bin/php -v <4> PHP 5.1.2 (cli) (built: Jan 27 2006 17:24:30) <1> emostar: What are the arguments you're p***ing in? <4> ./php$ ./createBook.php 10007 <4> : bad interpreter: ...... <4> ignore that ./php before the $ <5> Can somebody help me with what is wrong with this preg_replace() -> http://pastebin.com/535031 <1> emostar: What does it say before "bad interpreter"? <5> Should the pattern have some sort of wildcards? <6> TML, i see that apache use header_handler to setup the current content-type and Set-cookie. <4> ": bad interpreter: <japanese msg>" <1> emostar: ':' is the first thing on the line? <4> TML: yes <6> TML, but send_header it's used to setup the http response code. <1> Not '-bash:'? <0> TML: thanks <4> TML: no, only : <6> TML, with the reponse code isn't set into the header_handler ? <1> cdqs: send_header isn't used at all in the Apache SAPI, on send_headers <1> s/on/only/ <6> send_headers sorry <1> emostar: What is your shell? <4> TML: using bash <1> cdqs: That's correct, because the response code won't exist already. <3> emostar, why not trying php createBook.php 10007? <3> "php createBook.php 10007" <6> so send_headers is executed at the of script ? <6> script parsing <3> i dont think php files can auto-find the shell <1> cdqs: yes <4> hartym: that works <3> ok :p <4> hartym: i have another script and ./test.php works fine <1> cdqs: send_headers() is called right before PHP sends its content <6> why i don't retrieve content-type and set-cookie while send_headers ? <1> emostar: You must have some non-printable character after "/usr/local/bin/php" <6> before ub_write ? <1> cdqs: Because they're distinct actions: modifying existing headers and adding new headers. <4> TML: hmm i removed the line with vi, and rewrote it, but the same error is there.. <1> emostar: To get "bad interpreter", it has to be a problem with the #! line. <1> emostar: Other than that, I have no idea what to tell you. <4> hexdump shows some character before # <7> G'Night Folks! <1> emostar: "!" should be before # <1> !# <8> hmm... # is itrebal <9> if i have this array, http://pastebin.com/535034 , is there a function to see if a value exists in the sub-arrays? i.e. see if 'wordpress-plugins' exists? i guess i could loop through each array item and then check each value array, but i'm hoping there's a cleaner way <9> in_array doesn't look like it'll do it from what i can tell <1> Oh, sorry...ignore me. :) <4> TML: umm are you sure? <1> emostar: No, I'm currently fighting the effects of my medication. <4> TML: perhaps i found the problem.. the line ending is \r\n <4> TML: on my other file it is just \n (0x0A) <4> or is that \r :) <1> emostar: That's what I was guessing earlier when I said you have a non-printable <1> It should be \n on a unix system, \r on a mac
<1> !tell emostar about newline <1> emostar: But you should also not have anything before # on the first line <10> TML: Did you wrote php-bot? <1> tws: After a fashion. <0> TML: how do i ***ign a variable like $a[1]b = "foobar"; <1> likewhoa: You don't. <0> i mean with [$i] <1> likewhoa: That's not a valid variable name. <0> $a[$i]b = "foobar"; <1> likewhoa: You can't have [] in the middle of a variable name. <10> TML: Excuse me but what do you mean with after a fashion? :) <1> tws: Why are you asking? <1> likewhoa: PHP would read that as "the array $a, index $i, and a parse error because this 'b' is just hanging around." <10> TML: Out of curiousity. <0> TML: so how would it work with the foreach? i wanted to ***ign 4 variables like $a1foobar $a2foobar, 1 and 2 being the value from $i in foreach (range(1,4) as $i).. <6> ok i get it, header_handler == get all headers set and modify it if needed, and send_headers == use to send the startline + header to the user connection <1> php-bot: what are you? <1> bah....right, in private. <1> !+what are you <8> I used to be blootbot, but the code can no longer even be said to resemble the blootbot code. <1> tws: Does that satisfy you curiousity? <6> TML, header_handler is execute for each variable header ? <10> TML: A little bit. Thanks. <1> likewhoa: It doesn't make sense to ***ign variables like $foo1. That simply indicates that you should be using an array $foo, with index 1 <1> cdqs: I don't recall offhand. It should be obvious from the code. <10> likewhoa: Don't make simple things complicated. <0> tws: w/e <0> TML: let me paste what i have so that i you can see what i mean.. <1> likewhoa: If they're not related, they should have distinct names. $foo1 and $foo2 implies a relationship that is not being enforced. Either they HAVE a relationship, in which case you'd use an array to enforce it, or they do not, and you shouldn't name them as though they do. <1> There's no middle ground there. <6> very strange this header_handler :P <1> cdqs: It's a callback function that lets you change headers from within PHP <1> e.g., header("Location: URI") <6> yes but you can do this on send_headers isn't it ? <1> cdqs: No, you can't call send_headers() multiple times. <6> yes but you can folow the header list <6> zend_llist_get_first_ex(&sapi_headers->headers, &pos).. <1> cdqs: You can change headers at any time using header_handler <1> You don't have to buffer them until the end. <0> TML: http://rafb.net/paste/results/KXELHB87.html <6> let me see. brb. <6> thank you very much TML <1> likewhoa: There is a relationship there. They should be in an array. <0> so range should be array then? <1> What? <1> No. <1> likewhoa: You shouldn't be trying to get $keyf1, but should use $keyf[1] instead <0> i want it to ***ign $keyf1,$keyf2 etc.. with the value from mysql_insert_id() so that i can use it on another statement <0> wouldn't $keyf[$i] be $keyf1 and so on? until 7 <1> likewhoa: You can use $keyf[1] just fine. There's no reason to change its name. <0> but how would it set keyf[2] if not by hand? <1> likewhoa: I don't understand that question <0> well on that foreach it's doing 'insert into tlbname' and mysql_insert_id() is unique thus i need it to be in separate unrelate variable names.. so i figure i use $i as value after name. i.e $keyf1 <1> likewhoa: What do you need it in "separate unrelate variable names"? <1> That part still doesn't make sense. <0> so i just wanted to get that value into a variable so that i could reference it later. <0> TML: well it's running 'insert into tlbname' and each time mysql_insert_id() is different and i wanted to make 7 unique variables holding that value from mysql_insert_id() <1> likewhoa: But *WHY* <1> Why do they need to be different? <1> Just take each index from $keyf <0> so $keyf[1] = mysql_insert_id(); would create the arrays? <1> What "arrays"? $keyf[1] = mysql_insert_id(); creates ONE array, $keyf. If you want just that one piece, you can get it from $keyf[1]. <11> if(!strpos($file, "blah")) { <11> any reason why that doesnt work? <0> if (!strpos($file, "blah")) { <1> php-bot: php.net/strpos <1> Err...pimpwell: php.net/strpos <1> Read the warning <0> TML: so $keyf[1] = mysql_insert_id(); would created 7 arrays, and i could access array7 with $keyf[7]? <0> TML: i mean from the foreach (range(1,7) as $i loop <1> likewhoa: No, $keyf[$i] = mysql_insert_id(); creates *ONE* array. <0> rgr <1> You'd access position 7 of the array with $keyf[7] <10> TML: Gosh, you have a limitless patience.
Return to
#php or Go to some related
logs:
boobsfff #python compiling drivers ati 64 linux #kde remove php5 debian 4.0 #linux Tikitaki Wiki
newtupe
linux eth0 0x264 ubuntu This codecs.conf is too old and incompatible with this MPlayer release
|
|