| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Comments:
<0> what is the difference between ( !$_FILES['userfile']['tmp_name'] ) and ( $_FILES['userfile']['tmp_name'] != NULL ) ?? <1> Etobicoke27m: they're the exact opposite? <2> netbeans is slow as **** <0> evulish: are you asking me? <0> I'm asking you :) <1> i'm saying that's the difference <1> but it seems rather obvious <0> well... I thought ! preceeding a variable meant "if the variable does not exist, or is null" <1> != = not <0> ****... heh... I just realized what I did <0> what I MEANT was.... is $_FILES['userfile']['tmp_name'] is the same as $_FILES['userfile']['tmp_name'] != NULL <0> ? <0> can I just do a if ( $_FILES['userfile']['tmp_name'] ) { <0> I know it sounds like a dumb/easy question... but just wanted to make sure I dont have to explicity say != NULL <1> you should really just use isset()
<1> otherwise you'll just generate a whole bunch of notices <3> google march 20th for the best holiday ever <0> evulish: ok... thanks <1> **** NOTHING WILL DO WHAT I WANT <4> stop using java? <4> python ftw <1> i can't <1> i'd use anything over java <1> it's so ****ing convoluted <1> how do you get **** done <4> jython? <1> you dig and dig and dig and dig to find something to use <4> yeah <4> that's Java for you <1> i still haven't found a way to do what i want <1> it's been like 4 hours <1> i've written code that almost sorta worked <4> lol <4> I find it funny that ****ing insanely complex **** is easy in Java <4> but <4> Insanely easy **** is ****ing impossible <1> haha. <1> import java.util.QuantumMechanics.* <1> yeah, that's part of j2se now <4> use a security manager to restrict access to ssl encrypted data using SOAP? no problem. <4> sort a hashmap? Jump through hoops, bitch. <1> well, for the simple stuff it's because there are like 800 similar things <1> java.****me.bananas is the same as java.****me.apples but the latter one doesn't allow the letter 'b' <0> yeah... I took a Java course in college - didnt like it AT ALL <5> Poutine you about? <4> evulish_: of which 481 are deprecated <0> what's the best way to structure a db UPDATE statement to only update the table field if the user has populated the html form field ? <4> uh <4> by using an if statement? <0> doh! <4> if ispopulated(thehtmlformfield){ doUpdateSQLstatement() } <4> pseudocode there, of course <0> yeah... but I'll need to place my if's inside the UPDATE statement <4> why? <4> sounds like bad design practice to me <0> well because.... the update statement will be dynamically generated <4> why? <0> based on which form fields are populated <4> sounds like bad design to me. <0> I dont want to update a db field if the html form field has not been populated <4> then don't <4> use a block of if statements to test each form field <4> and dynamicly build an UPDATE sql string <4> and keep track of whether you added ANYTHING to the sql string or not, and if not, then don't run the update <0> so you're saying use multiple UPDATE statements ? <4> no <4> one update statement <4> build it dynamically <4> sqlstring = "UPDATE table "; <0> right <0> a series of if statements to create the string <4> if if ispopulated($thehtmlformfield_userename){ sqlstring .= " SET username=$thehtmlformfield_username"} <0> and then run the string <4> etc <4> yeah <0> if I'm using switch statements instead of if statements, is this valid? case isset:
<0> or do I need to say case isset($_POST['var']): <0> so far I have switch ( $_POST['var'] ) { <4> sure <4> just don't break <0> is it efficient to use switch statements with isset ? <4> sure <4> regardless of efficiency, it's pretty much the only way to do it <0> so case isset: is valid ? <0> without using brackets or anything? <4> what would you need brackets for? <0> ie. case isset(): <0> or case isset($_POST['var']): <4> I'm not following you <4> as opposed to what? <0> case isset: <6> isset what? <4> isset is a function <0> will case isset: give me an error? <4> and () aren't brackets <4> they're parenthesis <4> of course it will <0> haha... yeah that's what I meant <0> well... if I have to name the variable twice then is it not more efficient (less typing) to just use an if statement? <4> um <4> more efficient does not mean less typing <0> or does the switch statement execute faster ? <4> I think you need to re-read what a switch statement does. <0> I know what it does <4> obviously not <4> switch takes a variable <4> and then case statements test values against that variable <0> yes I know <4> ok <6> where are you testing against a value? <0> same thing can be accomplished using an if <4> roughly but switches are more efficient <0> faster execution time right? <6> better to use a switch than a bunch of if/else statements <4> yes <4> and readability <4> and also switches provide an easy mechanism for an exclusive selection of a single pathway <0> yeah.. thought so <4> switch($_POST['val']) { case '3': { dostuff(); break;} case '4': { doOtherStuff(); break;}} <4> etc <0> so if I have switch ( $_POST['var'] ) { case isset($_POST['var']: $num_populatedfields++; break; } <0> that is fine? <4> no <4> thats wrong <4> thats essentially saying if $_POST['var'] == isset($_POST['var']) <4> which makes no sense at all <4> and again shows me you have no grasp of what a switch statement does <0> ok so then I cant use switch statements for what I'm trying to do <0> I just want to say "if the variable is set increment a different variable" <0> thought I could do it using switch statements <4> nope <0> k.. my bad <6> do your form fields match your sql column names? <4> http://www.cafepress.com/buy/Cat/-/pv_design_details/pg_4/id_8143964/opt_/fpt_/c_/hlv_t <6> sweet <0> ummm.... nope <4> hehe <0> Robdgreat: and if they do? <6> you could do a foreach($_POST as $key=>$value) { if(isset($_POST['key'])) { $query .= "$key=$value"; } } <6> well <6> something similar to that <4> oh yeah <6> It's late, I'm half asleep <4> that's an awesome way to introduce some good SQL injection too. <4> :P <6> sssshhhh <6> you're ruining my evil plan, biatch <4> Sorry, I forgot that you were trying to take over the world today. <6> no problem
Return to
#php or Go to some related
logs:
forum incestchat #linux #kl #chat-world philips saa713xhl driver maaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa courtney act - rub me wrong.mp3 ABE for sops
#chat-world #kl
|
|