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



Comments:

<0> s
<1> print_r($ins_fields["data"]);die();
<0> already done it deus -- ins_fields is fine
<0> oh -- for the value you mean
<0> one sec let me try that
<1> no
<1> i meant what I wrote
<0> i have done that before
<0> $ins_fields has all the data I want
<1> ok, then make sure 'type' is set on all of the variables as well
<1> otherwise it will skip it in that loop
<0> the problem is that somewhere along the line, the loop stops storing the data, because the counter is not counting correctly
<2> rosenjon: then find the point at which the counter stops counting. echo is your friend. as are print_r and var_dump.
<3> rosenjon: it is hard to say what is going wrong, we could shake the magic eight ball to see what the problem is
<2> of course, I find it hard to believe that the counter stops counting correctly.
<0> well -- by adding to the counter, i get more output



<0> so "correctly"
<0> is subjective
<2> the counter still counts correctly. somewhere, you're doing something else wrong.
<0> im open to the possibility
<0> let me check the variable type thing
<2> check everywhere inside the for loop to see if you're adding or removing anything from $ins_fields
<2> rosenjon: also, are any numbers skipped in the indexes of $ins_fields['data']?
<0> yes
<2> oh, that explains it, then.
<0> i think you're on to it
<0> how to fix then?
<1> foreach($ins_fields["data"] as $num=>$array) {
<1> or, for you
<2> Yeah. Use foreach.
<1> foreach($ins_fields["data"] as $i=>$array) {
<1> and then replace $ins_fields["data"][$i] with $array
<1> in that whole section
<0> k
<0> one sec
<0> let me try it
<1> so it will look like $array["value"]
<1> and $i is still your iterator if you need it
<0> deus -- there are numerous instances of ins_fields["data"] already in script
<0> anyway to change just counter without having to change all those values
<1> you need to change it everywhere in the for/foreach loop
<1> yeah
<0> http://cvs.sourceforge.net/viewcvs.py/tikiwiki/tiki/tiki-view_tracker.php?r1=1.72.2.36&r2=1.72.2.37
<0> similar problem.....that was the fix
<1> you could probably just leave it
<2> rosenjon: for loops don't work that well for arrays with non-contiguous indexes.
<1> now that I think about it, there's no reason you couldn't just use foreach($ins_fields["data"] as $i=>$array) {
<1> and not change anything
<1> _should_ still work the same for you
<4> Hello; When I delete an array element using unset(), I get a "hole" in my array. Is there a function to fix that hole?
<0> it makes sense why it is messed up now -- when you are logged in as admin, the index never skips, because you are shown, and can update, all values
<4> Iow, the index are not contiguous when I print_r($arr)
<0> it is only when it skips that it starts screing up the count
<2> ppl: array_values()
<4> CryWolf: so unset($[$key]); $a = array_values($a); ?
<4> $a[$key]
<2> ppl: right
<4> Ok ill try this thanks
<3> ***uming your keys are auto keys of some sort
<0> Deus -- you da man!
<0> that worked like a charm!
<1> foreach is da man :-)
<0> indeed
<4> Well well, good news. That seems to fix my bug. Thanks a lot CryWolf!
<0> actually -- that is a lot more elegant than the sourceforge fix i sent you
<0> probably should have that one changed as wel
<0> Deus -- foreach($ins_fields["data"] as $i=>$array) {
<0> what does $i=>$array do?
<3> rosenjon: did you read the documentation on foreach?
<0> nope
<0> but am going there now
<5> rosenjon: good idea to do that.
<0> will that explain?
<3> perhaps, try php.net/foreach
<5> rosenjon: it should.
<3> s/should/will
<0> ok i have read -- everything makes sense, except for the fact that $array could theoretically be called anything, right?



<1> yeah
<0> just seemed weird to me
<6> /WIN 1
<7> i
<7> hi
<7> my index.php files are serverd in text/plain format
<7> and all other files names are ok . whats wrong?
<8> php got turned off on your web server somehow
<8> or was never enabled in the first place
<9> you didn't finish setting up PHP then. If you're using apache you'll need to add the AddHandler lines from your PHP INSTALL file
<1> LoadModule php5_module /usr/lib/apache2/libphp5.so
<1> AddType application/x-httpd-php php
<7> i have php4
<7> whit this config
<7> LoadModule php4_module modules/libphp4.so
<7> # Add index.php to your DirectoryIndex line:
<7> DirectoryIndex index.php
<7> # Uncomment one of the following (but not both)
<7> # Use for PHP 4.x:
<7> AddHandler php-script php
<3> romdav: use a pastebin for things like that
<7> is the same whit AddType application/x-httpd-php php line added
<3> you sure you dont have a asian AddType?
<7> yes
<3> romdav: how did you install php?
<10> hey, anyone have advice on cramming over 150 variables into an "insert into" statement in an easy to maintain way?
<3> stevarino: re-write your db design?
<7> im install apache and php from source
<10> zircu: its simply a lot of flat data, no relationships... maybe 70 bools
<8> for each key in array
<8> set row to key
<5> stevarino: with an array and a foreach loop to put each thing into one variable
<3> stevarino: well, where do you're 150 vars exists? in an array?
<10> yah, ***ociative
<10> 131 bools in there
<7> if i change the script name to other.php the script are serverd correctli, but whit index.php are served in text/plain
<8> are there 131 columns in the db you want to insert them into?
<8> and are they in order?
<3> romdav: typically php's 'make install' should find and install things correctly if they both were installed manually, ***uming you dont have duplicate versions of either installed by the OS's package system
<10> omnipresence, unknown, this feels like a messy project (its just a quick fix i'm hired for right now)
<3> stevarino: what database & version are you dealing with and what php version do you want to write for?
<11> hi all. what's the proper way to escape line breaks in php.ini's include_path?
<11> is splitting: include_path=".:/dir1:/dir2"
<11> as: include_path=".:/dir1\
<11> :/dir2"
<11> 'legal'? if not, what's good?
<3> OpenMacNews: please dont paste your questions
<7> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --prefix=/usr/local/apache2/php --with-config-file-path=/usr/local/apache2/php --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext --with-gdbm
<3> romdav: looks good
<10> zircu, not sure but i'm betting php 4
<11> zircu: and do what instead?
<3> romdav: and you say that php files are served as plain/text? after you do a make install on php?
<3> OpenMacNews: type the question, if you can't explain it in a sentenence then post the code you have to a pastbin, and ask your question according to that
<1> stevarino: you can do that pretty easily using ADODB
<3> stevarino: and the database?
<10> mysql
<11> we. what's the proper way to escape line breaks in php.ini's include_path?
<11> example: http://pastebin.com/637166
<3> stevarino: well, if you have an ***ociative array, that matches the column names, there are several ways to do it easily, the trick is making sure you aren't prone to sql injections
<10> i had the damn php-info, but accidently cleared out my browser history.. so i'm kinda lost until i speak to the client again :)
<12> hello every one :)
<12> can some one help me :)
<10> zircu: i'm already doing an array_map( "mysql_real_escape_string", $form_data );
<12> i have membership to some place from where i can generate registration code :)
<7> how?
<12> the use post method to generate licenses but i can make one license at a time
<12> all i want to make 100 licenses at a time using php code or some thing ?
<12> how can i do this ?
<7> yes, only the index.php, if the file are called other.php work great
<3> OpenMacNews: you can't do that
<13> is it possible to use ajax/php...opendir loop and count the files and squirt the numbers of files into a div?
<13> is it possible to use ajax/php to opendir and squirt the numbers of files into a div?
<13> grrrr
<13> sorrry


Name:

Comments:

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






Return to #php
or
Go to some related logs:

udev_make_node mknod capi
lexigraphically c++
install kinit ubuntu apt-get
dsb+c120 driver to linux
#css
ldd raf256
Creating View PHPMYADMIN
#openzaurus
#debian
Partitions de Nick Lachey - What's Left Of



Home  |  disclaimer  |  contact  |  submit quotes