@# 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



Comments:

<0> cya
<1> GregV|Away: myspace.. is it safe? zZzzzzz
<2> is it possible to change a php.ini variable for a virtual host?
<3> Can't local variable be declared in a for loop?
<4> No, there is no block-level scope in PHP.
<3> But it can be in if statement
<4> No.
<4> Any variable defined in a block is scoped to the nearest function, or global.
<5> block level? like GOTO/GOSUB?
<4> Jymmm: Like, for (blah) { $foo = 'foo'; } where $foo only existed within the block.
<5> ah
<4> Certain languages have it.
<3> strange why it works then
<3> Maybe because if is inside a function?
<6> i'm testing to see if a cgi value was submitted like this "if ($_POST['delete']) { do_stuff(); }'", but that leaves errors in my apache log, is there a better way to do this?
<7> another night in the trenches...



<8> is this #mysql?
<9> no
<10> lol
<10> the clue is in the (very negatively written) welcome text
<8> ;)
<8> just thought it was a funny welcome text
<10> yeah
<11> hello
<8> having a hard time with this problem
<8> let's see if you guys can outsmart me
<8> http://img522.imageshack.us/my.php?image=regex0ho.jpg
<11> i'm building and order page... is there a way to get that page so i can send it by e-mail? or do i have to recreate it even for the email?
<8> that is a text file, with columns sorted by SPACES. I need to delimit each one with a comma to turn it into a csv file
<8> easy enough, but I don't want any white spaces, and I can't seem to figur eout how to do this, honestly
<10> The IMG didn't show on my client
<8> been using a series of regular expressions on it, but that may not be the easiest way to do it
<10> Sal, You can capture output to a string, but it probably isn't what you want.
<11> stestagg: replace every space by ";"
<11> stestagg: then replace ";;" by ";"
<8> $f1 = trim(substr($line, 0, 30)); might be a good way to do it, but it'd take quite awhile...one call per line?
<8> stestagg: http://rafb.net/paste/results/zWadd798.html
<11> ops, that was for regress
<11> sorry
<8> that's the actual text
<11> regress, do what i said
<11> is the text all in a var?
<10> Sal: lol. Because sending HTML in Emails is not easy without a PEAR extension.
<8> sal; if you look that the left hand side, some of the text has spaces in it
<8> sal; I
<8> I'm using file_get_contents()
<10> sal, no. You have to buffer the output and then copy the buffer to a string before flushing it.
<10> regress: what's wrong with regex??
<8> then running a series of preg_replace() on it
<8> nothing just having a hard time with the expressions, they're not quite working
<11> stestagg: thats the only way?
<10> I think so. but it DOESN'T work that way with HTML, you have to be more clever
<10> coz to send HTML in an email, you have to create an attachment with content-type text/html.
<11> ok, i'll send plain text
<11> and rebuild the order output
<11> :(
<10> regress: wait a mo, I'm thinking :)
<8> no problem
<8> regex ispretty fun, like a puzzle...but after a few hours working with them, my head is hurting
<11> regress: so this is the wa y to do it: 1) frst split every line by the col that starts numbers
<10> lol. I know the feeling
<11> so you have texts and numbers
<11> then do what i said before
<11> ok?
<8> sal, won't that still put a ; between the words that have spaces?
<11> no
<10> regress: yeah sal is right, replace only double spaces and then TRIM the output
<11> in the left part, you wont replace " " with ";"
<11> but only do a trim(text)
<11> 1) split text
<11> 2) left side only trim(text line)
<11> 3) right side, replace " " with ";" and then replace ";;" with ""
<11> ops, last with ";"
<11> thats it
<10> or...
<10> take a line = $text
<10> $text=trim($text)



<10> $text=str_replace("_ _",";",$text);
<10> where _ = space
<2> what do you think about xoops? do you think it is a good cms?
<7> toshiro: meh.
<7> toshiro: i found that their 'marketing' is alot different than the product itself
<10> while ($count>0)str_replace(";;",";",$text,$count);
<10> then you have $text delimited with ;
<2> ^Artnez, do you use a cms?
<10> explode(";",$text);
<7> toshiro: no, i write one -_-
<2> ^Artnez, what is your site?
<10> regress: Hope that makes sense
<8> stestagg: lemme give it a try
<8> only problem is some of the number cloumns don't have the correct spacing...
<7> toshiro: artnez.com .. why?
<8> damn old accounting programs, how can they not export to csv???
<2> ^Artnez, is your cms free'
<10> regress: ?? how do you mean?
<7> toshiro: oh, heh, you misunderstood
<7> toshiro: i didnt write an open source cms available to the public if that's what you though
<12> I dont understand.. some of my PHP scripts are mysteriously not working
<7> toshiro: i wrote one for my company to use from project to project
<10> Silivrenion: That's helpful...
<2> ^Artnez, what do you objectively reproach to xoops?
<7> toshiro: well.. the "OO" in XOOPS is a bit misleading to begin with...
<12> stestagg :: theres no error message to output.. the scripts just dont give anyy output..
<12> I tell my contact form script to work, and it doesnt move.. it just sits there, not processing anything
<7> toshiro: i also find it a little overcomplicated for the task of setting up a site -- see for yourself. it's all opinion.
<10> Silivrenion: then write print statements after every line and ob_flush() calls and see where they stop
<13> so I have a mysql resource which has in it a whole table... how would I get it to skip to and display a row where a field has a certain ID or value?
<2> ^Artnez, i agree with you there, i havent found somthing object and simple
<7> toshiro: what kind of site?
<10> callipygous: erm. why can't you use a MySQL statement?
<13> stestagg, I could... but that would require doing another query
<7> callipygous: you have a mysql resource that holds a table? how is that possible?
<13> and I'd like to know how to do it the other way
<13> ^Artnez, you tell me
<2> ^Artnez, i don't know what to say for a simple site...
<7> callipygous: a mysql resource stores a unique connection handle for a MySQL connection in PHP
<13> oky
<13> im not exactly sure of all the workings yet
<7> callipygous: post some code
<10> callipygous: As far as i know, either you have to do another query, or you have to download the whole dataset and then loop through it checking for the correct field.
<14> Pollita: "In Googlis non est, ergo non est."
<13> I mean usually id mysql_result($query, 0, 0)
<10> TML lol. Tho Yahoo is biting back slowly
<7> jeeves is gone :(
<13> but in this case id like to mysql_query($query, and here id like to specify which field) probably not possible, but another way?
<7> i miss jeeves .. he was so .. elegant
<13> jovial?
<8> sal; what should I split the text by?
<7> callipygous: when you run a MySQL query, you get a certain result set. you then need to tell PHP how you want that result set structured.
<7> callipygous: in most cases, you want to do something like mysql_fetch_array()
<10> regress: Sal is suggesting you split it into fixed width chunks.
<13> is that better than mysql_result($blah, 0, $i) ?
<8> ahhhh
<8> heh
<8> I see
<8> unfortunatel, each file may have different width chunks
<10> regress: Did my suggestion work??
<7> callipygous: that depends. you have to know exactly which row and exactly which column you want to retrieve
<8> stestagg: lemme give yours a try
<10> ^Artnez: excuse?
<10> callipygous: You have to do both.
<13> how so?
<7> stestagg: what? he has a result resource already
<10> callipygous: You use mysql_query to get MySQL to actually run the query then use mysql_fetch_array or mysql_fetch_***oc or mysql_fetch_field to get the results
<14> Or mysql_result(), as you've already stated.
<15> FlamingCows, nvm
<15> i got it finished and working properly
<7> stestagg: mysql_fetch_field will only go down to a specific column
<14> mysql_result() would be the least number of lines of code, ***uming you already know which row and which field you want.
<7> stestagg: mysql_result will allow him to fetch a row/field combo
<10> Ah sorry, I can't read. My Bad


Name:

Comments:

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






Return to #php
or
Go to some related logs:

#bash
#gcc
#css
#debian
#math
f spot sucks
rhythmbox not an audio stream ubuntu
#debian
rawsweets
+ubuntu+locale+iocharset+java



Home  |  disclaimer  |  contact  |  submit quotes