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



Comments:

<0> is there a way to put the 'cursor' to an html <input type="text">, as in I want the user to be able to type as soon as they enter the page
<1> document.focus.getElementByID('name'); I believe
<1> or something similar
<2> rjokei: I think you need javascript for that.
<0> k i will research that tnx
<0> farrioth: dat suxx
<0> tnx
<2> Wilik: I can't get that to work.
<1> farrioth, http://us3.php.net/manual/en/function.mysql-affected-rows.php
<1> need to p*** your resource link identifier
<2> Wilik: That says it just gets the number of effceted rows.
<1> which is what you asked for
<2> Wilik: No, I want to know which (not how many) rows have been effected.
<1> by an insert?
<1> usually 1
<1> since you just added 1 to the table



<3> In an insert, the one you have just added is the one that has been affected.
<1> if you do an UPDATE or DELETE, it'll return more then 1
<1> or just 1
<1> or 0
<2> I want to know _which_ row has been affected.
<1> mysql_insert_id()
<4> farrioth: then use a select witht he same where clause as your update ....
<4> oh, you're talking about insert?
<1> yes he is
<4> (that's what I get from jumping in at the end)
<2> I create a row, then I want to tell some code which row I created, so it can shove some values from a form in it.
<1> use mysql_insert_id()
<1> http://us3.php.net/manual/en/function.mysql-insert-id.php
<2> Okay, that looks like what I want. Thanks.
<1> you should be more specific next time ;)
<5> Lies.
<1> and trickery!
<2> I consider "How do I found out which rows have been effected by an SQL INSERT query?" specific enough.
<1> this " I create a row, then I want to tell some code which row I created, so it can shove some values from a form in it." was better though ;)
<2> You have a point.
<1> anyways, problem solved so it all worked out in the end
<4> farrioth: not at all, if there are triggers or some such then other rows and/or other tables can be affected when you insert one
<4> farrioth: asking how do know the id of the row you just created is specific
<6> in regular expressions do spaces count or is \s the only way?
<4> joe4444: a space usually counts as one whitespace, of any kind
<4> iirc
<2> AcidReign: Hmmm, okay.
<4> I haven't done regex in a while
<4> farrioth: don't quote me on that though
<4> but it's generally done as \s+ to match any amount of space between two sub patterns, or literals
<7> how do i remove a specific key from an array?
<8> unset($arr['key']);
<7> thx
<9> Pollita: you a part of the php dev crew?
<9> if so, why is this an "about" channel
<9> (hi btw ;)
<10> is there a function that will return the smallest integer in an array?
<11> Well, you could sort it and unshift.
<6> so would this regex /^" \*{9} FOOBAR \*{9} "$/ match this?
<6> " ********* FOOBAR ********* "
<6> double-quote, 3 spaces, 9 *, 3 spaces, FOOBAR, 3 spaces, 9 *, 3 spaces, double-quote
<10> duh, sorting would do the trick, silly me :-)
<10> thanks
<12> Does PHP allow the following: myFunct( ($a == 1) ? "blah" : "no", "doodle"); ?
<6> why not just put that first argument on the first line of myFunct(foo, bar) ?
<9> abuse of ternary operator!
<13> My attempts at using mail() have been futile ... does the From: address need to be anything in particular?
<14> joe4444, try \\* instead of \*
<15> some regexp guru to help, I want to change <img src="pic.jpg" alt="desc" /> to [img]pic.jpg|desc[/img] ?
<16> hello, i'm looking for a cheap but reliable enough php5 host. what do you guys think of 2mhost?
<10> ok, my problem isn't really solved because I thought I could use an array, but I think it would just make things more complicated... what I actually have are three integers taken from three different fields in the same table, and I need to figure out which is the smallest so that I can replace that specific integer with a new one...
<2> Hmm.. It seems to sort items.
<13> snort_items("crack cocaine", "pixie-stick dust");
<10> er, I can't find a sort_items on php.net
<6> Julian|Work, with \* it will read "find any number of \ backslashes" ?
<12> You can't use the ternary operater in setting the value of a variable, either?
<8> Sure you can.
<12> And adding to it?
<8> Sure



<8> But not using that syntax
<12> Pollita: Ah, which syntax then?
<8> "foo","bar" is unique to parameters and echo arguments
<8> Use a . there
<8> Also, you should group whichever expression it is that you want to have precedence (I honestly can't tell)
<8> Oh wait
<8> ****
<8> nevermind
<8> You *are* calling a function there
<8> Your syntax is fine
<12> I mean, something like: $var .= "Bumble ", ($_POST['oui']) ? "Bees" : "Hives", " Rock";
<12> Is that syntax okay?
<17> Once I have set a session cookie on a clients machine, how would I set a secure token that identifies the client?
<17> Google isn't giving me too much that is good
<12> Pollita: What I just showed only seems to add the "Bees" or the "Hives"... it doesn't add anything else for some reason.
<5> wtf.
<12> Any ideas anyone?
<18> howdy all
<19> Does any one know if there is a disadvanged to storing a serialzed cl*** object as a SESSION cookie, and deserializing it every instance it is accessed?
<20> hi
<19> s/disadvantaged/disadvantage/
<18> kambei, not that I'm aware of... I usually do it with arrays, but cl***es should work the same way as far as I know
<4> kambei: several, it's generally a bad idea to store objects in sessions
<20> hi
<19> AcidReign: Why is that?
<18> AcidReign, why?
<4> kambei: 1) if your cl*** is not defined before the session is loaded, the object is mangled
<11> It can become inconvenient to need to load every cl*** which you serialize objects for before calling session_start
<4> 2) references, expesially recursive/cirular ones can cause problems
<11> Not to mention having to know ahead of time which cl***es may be needed.
<19> Well, it's been working without incident.
<4> 3) any Resource types are not serialized (DB connections etc)
<21> yo yo
<18> ahhh
<4> if you're going to store an object in a session, that object's cl*** has to be defined/included on/before EVER page that starts the session
<6> is there a regular expression special character for this? [0-9a-zA-Z]
<19> That is already done.
<21> damn im paranoid
<19> joe4444: [:alphanum:]
<6> kambei, does that include underscore? ...like \w
<19> AcidReign: How do you propose the object is stored/handled?
<19> joe4444: No.
<19> joe4444: It includes [0-9a-zA-Z]
<21> anyone ever go tanning
<6> would this find any line starting with a 'product code' inside double-quotes in the format of 4 decimals, a hyphen -, and 3 alphanumerics?
<6> . /^"\d{4}-[:alphanum:]{3}"/
<22> i hate regex
<4> kambei: dont store the object. store the required values, then recreate the object on the next request from those values.
<11> That's what we do at my day job.
<19> AcidReign: The objects are very complex.
<23> so what's this deal with google/yahoo/ms/cisco & china?
<23> there's some new up and comer who's not playing ball?
<4> kambei: which is even more reason not to store them in a session
<11> kambei: Maybe they're not really what you want to be serializing, then. How much of the object really needs to be maintained?
<4> kambei: it only works properly with simple objects...
<4> refer above where I mention complicated references can get broken
<4> you may end up with way more in you session than you want, also
<19> Can you give me an example of something that will get broken?
<4> and then there are Resources that can't be stored.
<11> kambei: Anything involving references.
<19> I see.
<19> I could restore the cl*** on each transition by extracting the values via mysql queries.
<19> But I kind of wanted the cl***es to persist across transitions.
<7> whats the function in php thats converts a string with spaces to %20
<22> str_replace
<22> " ","%20"
<22> dumb***!
<11> http://php.net/rawurlencode
<24> the-drew: why the agression?
<19> I'm pretty sure he was kidding.
<24> i hope so...
<7> i hope so too.
<22> i apologize
<24> it doesn't matter...


Name:

Comments:

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






Return to #php
or
Go to some related logs:

dpkg-reconfigure phpsysinfo
#perl
Match quotes with preg_match
#web
java ata1 timeout without command
winetools reposit
conky xcompmgr shadows
xrandr 203b
#kernel
#web



Home  |  disclaimer  |  contact  |  submit quotes