| |
| |
| |
|
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 34
Comments:
<0> zircu: yeah, what's wrong with that? <1> whoohoo: i have no idea what your are now trying to do <1> Deu***: well because you will have to file_get_contents(), which will put into memory, then append to the data, then file_put_contents() <2> a+ should write to end of file <2> so i shouldnt need to append anything <0> zircu: no, there is an append flag on file_put_contents <1> Deu***: at first you might think wow this is neat, but then after you get 1000 hits a minute you're thinking.. oh my my memory is being used needlessly <1> Deu***: oh, and on top of this.. this does require php5 :) <2> deus -- if my path is ./logs/file.txt, where will this be relative to <2> to the current directory of the php file? <0> zircu: it's just a simplified wrapper that does all the same stuff. I don't think it works any differently if you implement it right <3> if i want to add a value to $array[x][(incerement)] = "xx"; and i do $array[x][] = "xx"; how come it gives me an error; <3> Fatal error: [] operator not supported for strings <0> zircu: actually, i retract that <1> Deu***: true, i wasn't aware of the append mode, that makes a big difference <1> with the append mode i can see some real good uses with it.. like a log collector that that writes every 1000 entries or something like that
<0> zircu: it always performs the 3 operations consecutively, so in your case with 1,000 hits/min/sec whatever it might be better to just do a fwrite successively <4> whoohoo: yes. the question is, which is your current working directory? ;) <3> any1? <0> whoohoo: see deadroot's comment above <2> deadroot -- so it is relative to working directory, i.e. html root, or to directory of php file im coding <4> try $array['x'][] = 'xx' <3> x = a int <0> relative to wherever the parent/calling php document is located <3> not even a variable in my program <1> ak_47: what is $array before you start? <3> array is full of strings <3> 1d array... <1> ak_47: are you sure? <3> well hmm, im doing <1> ak_47: if you are getting that error that means somewhere you are trying to make an array of a string <3> $cast = array_unique(array_values($z)); <0> curses to the ****ing java-php bridge and it's lack of documentation <5> Deu***: Please watch the language. <6> ak_47: var_dump($array[x]); <3> then in a loop, if (array_search($t[0], $cast)) { $cast[array_search($t[0],$cast)][] = $t[1]; } <0> TML: sorry, tourettes syndrome <3> basically i got a file with quotes by people,i want to make an array where its like $x[author][1] = "hi" then $x[author][2] = "hello" etc <1> ak_47: let me shake the magic eight ball <7> hi guys,, I am trying to create a daily sum from a dataset in an array. I am using the following function: http://pastebin.com/637231. but the output is http://pastebin.com/637233 ... anyi dea whay it is not summing up but instead creating new arry values sometimes, but not always? <1> ok.. this is making me mad.. how is it that these topics are all related randomly <0> the way the stars were aligned tonight <1> they must align every night <5> tokyoahead: It would be far better to construct your SQL appropriately so that it summed the values for you. <8> Uhm.. if I rewrite a url thats origianlly index.php?id=34143 to something like /index/stuff/ ..what happens to the GET-content? <1> babi: depends on your rewrite, better asked in #apache <5> babi: Don't use rewrite, that's too hard to get right. Would I be correct in ***uming you're using Apache? <8> yes.. but ok ill ask in apache then <5> babi: Look into MultiViews and use $_SERVER["PATH_INFO"] <1> babi: although, i would listen to TML, he is hinting to a better solution <8> mkey.. <7> TML still where is the error? <8> and there is no special demands on server-config etc? <5> tokyoahead: Impossible to say without knowing more about the data <5> babi: MultiViews has to be turned on, that's it. See the Apache docs. <9> Would you guys use mbstring.func_overload in production? <5> babi: But it's much easier on a server than rewrite <8> key, thanks <7> TML you ***ume that the data is different somewhere? <5> tokyoahead: I'm not ***uming anything. I'm saying that without knowing the data, I can't make heads nor tails of this code. <3> how do i find the how many values in $x[$b][]? <7> TML the second URL shows the data... did you look at it? <5> ak_47: count() <3> count($x) = in $x <5> tokyoahead: You said the second URL shows the (presumably incorrect) output <5> ak_47: Right. <7> TML I made a output for checking. it shows the data p***d to the check and how it comes out after the check <6> tokyoahead: since your code is next to impossible to understand, reading the output won't help us <7> MTL I should have said the second one shows out & input, sorry <5> tokyoahead: Well, your code makes a reference to $A[5], and http://pastebin.com/637233 only has two columns. <1> tokyoahead: so are we to randomly guess how you read that data into the array? <6> ak_47: count($a[$b]); <5> ak_47: Perhaps you're confused by the []? <5> ak_47: [] isn't part of the array's name. "$foo[]=$bar" is an alias for "array_push($foo, $bar);" <5> The array is still called $foo. <5> Or, in your case, "$x[$b]" <5> tokyoahead: 1) Why do you loop twice? 2) Which is $A[2] on the second URL and which is $A[5]? 3) What is $last_day? 4) Why do you set "$chart_data[$i-1]"? First time through the loop, that would be index -1. 5) Instead of a for() loop, use a while() loop. 6) var_dump() your data instead of echo'ing it, sometimes non-printables can affect things you never imagined.
<5> I could think of about 20 more questions, but until you clean this up a bit, it'd be rather fruitless to expend that degree of effort. <1> I simply wait for the answer how the data is read <5> Man, I need to get me one of these 1TB data units <1> i need a 2TB unit :) <1> what 1TB units are you looking at? <10> what's a good free uml creation app? <1> what is a good cancer curing drug? <10> what is a good piss-taking fool? <10> *BING* i know the answer :) <1> lra_: i'm not sure exactly what you are asking, but how is this related to php? <11> Any way to check if a mysql insert query was successful? So say, I wnt to say, if successful output "done", else, "say there was an error" <10> uml enables you to draw charts for actions so you can layout cl*** needs etc <10> gary_ if (mysql_error()) bad else good <1> lra_: and I wait for how what you are asking is related to php <12> hi <5> Or just: $q = mysql_query(); if ($q) .... <10> zircu - uhm, php uses cl***es no? <1> gary_: well when you issue mysql_query() on a insert/update/delete it will return 'TRUE' or 'FALSE' <12> i have a small query and i wanna ask some questions <10> or am i in the 'pretty horny people' channel ? <5> lra_: Try Google. I just Googled for the same thing last week and found a plethora of UML tools. <1> lra_: it uses while loops too <10> ? <5> lra_: In almost 10 years of PHP, I've only known one person who used UML for their PHP cl***es. <12> Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\khmertoday\header.php:7) in C:\wamp\www\khmertoday\profile.php on line 17 <11> thanks guys <5> lra_: So it's not something you're likely to find much help on. <5> !tell hasfsa about headers <10> TML - so have i, but found a load of commercial / 'free' but not really apps <12> i got this kinda error <12> i dont know what should be done to fix it <10> tml - pleased to meet you <5> hasfsa: Go look at your private messages from php-bot <12> i read it <12> but i still dont understand <12> can you give me breiftly explain? <5> hasfsa: Which part do you not understand? <5> It says you've got some output before you sent all your headers. <5> Stop doing that, and the problem will go away. <1> hasfsa: if you notice the eroror message, line 7 of header.php has started to send content but in you profile.php on line 17 tried to send a header, either inderectly via session_start() or a direct header() call' <0> you are too patient, TML <1> I agree with Deu*** <5> The problem is that I get consistently mixed messages on the matter. <1> as I do, but you are more patient than me <1> i give up if someone ignores my input, and If I repeat my answer they belive I'm elitist, and you end up getting blamed for my elitist stature :) <12> <meta http-equiv="content-language" content="en"> in header.php lines 7 and header("location:register.php"); <12> in profile.php in line 17 <13> heh <13> sounds like shoddy programming to me! <12> what's wrong with this? <5> hasfsa: You can't send headers after you've sent output. <5> hasfsa: Which part of that sentence do you not understand? <1> hasfsa: you can't do that, in most cases <6> what is output? :) <12> what i dont understand is what is my output? <5> hasfsa: When you start sending stuff to the browser <5> HTML, whitespace, text <5> Anything <0> <meta crap...> <12> so they are output? <5> Once you've started sending stuff to the browser, it's too late to send headers. <5> *No* output can be sent. that includes whitespace (outside of <?php and ?>) and any (X)HTML. <5> (As php-bot already told you) <6> i like it when people have html output before, as if to give their users .001 seconds to read it before the redirect :) <12> that mean i have to del all spaces outside of <?php ?> <5> hasfsa: It means you have to send all headers before you send output. <6> No Output before you call header(), in otherwords, call header() on line #1 of your script <5> Or "somewhere before the output" <12> isnt it related to the Session? <1> hasfsa: you have to rethink why you are trying to redirect in the middle of the page <5> It could be line 123,543,799,894,082 for all PHP cares. <5> hasfsa: *ANYTHING* that sends a header *MUST* be finished before you send *ANY* output at all. <12> zircu, because after registeration successfully i want to redirect page to into their profile
Return to
#php or Go to some related
logs:
wayttd ubuntu #linux regexp_replace toad
Couldn't find package make-jpkg unrar -kb ark option verbose terminate handler dsl sources.list ymessenger libpt_linux_x86_r.so FC5 /sbin/init: 432: cannot open dev/console #osdev
|
|