| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12
Comments:
<0> its a php issue tell freaker2k4 about it when he returns <1> CR000 <1> ask <0> ask whaT? <0> oh a php related thing? <0> how can i send adress of a function to another function in php? <1> with parameters <1> function1(function2()) <0> how <0> no not the function <0> adress of a function <0> so the function argument becomes dynamic <0> like if i go like function1(function2()) i am only limited with function2 <1> its another function for that, i read on php.net <0> i want any function to be parameter of function1 <0> not only 1
<0> oh k <1> wait let me check <1> http://ro.php.net/manual/ro/function.call-user-func.php <1> call_user_func <1> ;) <0> not like that :\ <0> like function x(functionhere,$var){ $var+=6; $var=functionhere($var); return $var;} <0> functionhere can be anyfunction i define <0> so i can also manipulate call_user_func <1> yes, that function, call_usre_func can call the function defined <1> so lets say you define <1> showtime() <1> no, showdate(timestamp) <0> k <1> echo('showdate',timestamp) <1> call_user_func i meant <1> echo call_user_func('showdate',timestamp) <0> no lets say i got showdate() showtime() showhello() and i got another one function show(function){ echo "showing": function(); } i want to be able to do show(showtime) or show(showhello) or show(showdate); <1> yes, here is how you do <1> function show($function) { call_user_func($function) } <0> ahh ok <0> thanks <1> no problem <1> also i forgot to add a ; to the call_user_func <1> if you want to use parameters, try to think it better, you can use is_function <1> :) <0> but lol <0> anyway thanks <0> nvm <0> :) <1> ok <1> i meant if you can p*** parameters for the functions in the parameters :P <0> :) <2> hi <2> please somebody help me <0> they ll help you if you help them <2> ok <2> it's something about php and mysql <2> got a problem <0> k why dont you come to point <2> ok <2> well I made a script that upload files <2> and all the files that I upload are save in my database because I use type blob <2> well, suppose that I upload test.doc <2> but later I want to upload the same file test.doc but the information in this file is different, well my point is this <2> I want to update the file <2> I want eliminate the old file(test.doc) and have the new file (test.doc) <2> got me? <0> reading .... <2> sorry for me English <3> paste your pastebin link <2> go to this link <2> http://phpfi.com/123081 <3> you need to do a select statement, with an index of your filename and filetype, if the result is not empty, then an entry already exists and you need to do an update instead of an insert <3> and if it is null, then do an insert as you're doing <3> http://dev.mysql.com/doc/refman/5.0/en/update.html <2> yes I tried but I think that maybe I wrong because I can't, it doesn't works for me <3> paste your attempt at doing what i just said... to that pastebing link... and link that here <2> ok <3> you should have a select query, then an if statement checking if its empty, and then either a update query or a insert query <0> well
<0> i never keep files in db <2> http://phpfi.com/123084 <3> i agree i wouldnt do it either... but i'm just trying to help him do what he's asking to do :) <3> basically he just wants to know how to overwrite an entry <2> well, I did it in a folder, but for my project I need it in my database <2> ammm not he... she <2> jeje <0> incase they duplicate? <2> yeah <2> that's right <2> I don't want duplicate <3> get rid of the "or die()" part <0> you should declare filename as constraint <0> yea <0> get rid of die <3> you dont want your script to comletely stop just because the file doesnt already exist <0> ahh man its a complicated task for explaining at 4:30am <2> ok... can you wait, because some words I don't understand jeje... :( sorry... but I'll try <2> where are you from? <0> make a constraint for your whatever you want <2> In my country are 8:21 pm <0> primary key or unique for file name <0> turkey <0> where are you? <2> Mexico <0> olas <2> Hola <2> salut <0> :D <2> :) <0> comes stas <2> bien y tu? <0> bien <0> anyway and then you do the insert if it returns 1062 <0> you do either update <0> or skip <0> you can do the update by like comparing the content of the file or partsof the file or size of the file <0> or get a hash value <2> well sorry I made some examples <0> crc32 or something like taht <0> or md5 <2> but I don't found it <2> I made one with update <0> and store it for comparing content eqularity <2> I put update before the insert statement <0> no <3> the one you just pasted looks like its almost right <0> first insert <2> or something like that <3> it's what i would do anyway... but i'm a complete sql noob... <2> can you write that lines? and paste in a link? <0> if you get duplicate error you check content match <0> if they match you skip <0> if not <0> you update <2> because some words I understand <0> i cant <2> oohh sorry <3> you think thats better than this CR? <0> 4:30 am here i cant even write my name+sirname <3> select entry, if exist, update, else insert <0> its same <0> yea <0> do as Kaell <0> says <2> ok, I'll try <3> http://phpfi.com/123084 <--- thats what it looks like he's trying to do here <3> but its poorly formatted, and i know ****e about mysql ;) <0> well i am not a pro mysql user as well <0> i find my way around though <2> me eather <2> that link that you post are my coude <3> where did you get $id from? <3> its not set anywhere
Return to
#mysql or Go to some related
logs:
were there 368,000 of in 1961 and 2,295,000 of in 1981 kasnurse run valknut #linux bookz+fedora document explorer crashes #AllNiteCafe geordiedebono shemael from.submit() onsubmit
|
|