Re: [PHP] Join question
On Saturday 01 December 2007, chris smith wrote: Considering the rest of the off-topic questions that regularly get asked on this list it's a bit much to single out this one particular post. I didn't single it out, it just happened to be at the top of the pile at the the time. It was also helped by the fact that the OP, who is apparently, renowned for programming in rocks since the time before binary was invented, ought to know list etiquette better than most. javascript, css, html - none is directly related to php but all still get asked here (and 99% of the time answered) - I don't know why you're making such a big deal about this particular post and haven't kicked up a fuss about the rest in the past. Exactly how big a deal did I make out of this one? I simply said ask on a database list. It is the responses to that which seems to be kicking up all the fuss. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Sunday 02 December 2007, Daniel Brown wrote: There are a great deal of highly-intelligent people on this list, so why not take advantage of that resource? I do, that's why I'm on the list. So until you've been around enough to truly earn your right to tell someone far more accomplished than yourself to seek help elsewhere, do us all a favor and keep your God damned mouth shut. AFAIK no list has the clause once you have made X number of posts feel free to do what you want. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
At 6:24 AM +0800 12/3/07, Crayon Shin Chan wrote: It was also helped by the fact that the OP, who is apparently, renowned for programming in rocks since the time before binary was invented, ought to know list etiquette better than most. That's world renowned, if you please. :-) But just to set the record straight, binary had been invented long before I came along. The programmers before then had to program in just rocks (1's). It wasn't until much later that the absent of rock was invented (0's). Now, you may not think that one can do anything programming with just rocks, but that's the way the pyramids were built. Those old programmers were an accomplished lot. As for me, with my vast experience, I think that list etiquette on an unmoderated list is what we make it. If you want to correct people as to list etiquette, it's probably best for you to join a list with people who care what you think. Unfortunately, I think you'll probably have difficulty with that as well. It's unfortunate that you can't take your talents and help someone instead of being so critical. To me, it would be a pretty sad life if I had nothing positive to say. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
Crayon Shin Chan wrote: On Friday 30 November 2007, Jochem Maas wrote: ... So let me get this straight, only paid up members of the old boys club are allowed to make off-topic posts? The rest can lump it? if by the rest you mean you, then yes, absolutely, please crawl back under the rock you came from and f***ing staying there you silly little troll. besides which it's rather pointless telling someone to go elsewhere for help when they already got the help and posted that they had solved the problem. That's for future reference. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
Jay Blanchard wrote: [snip] If you try you can probably make a connection from php to everything under the sun, doesn't mean everything under the sun is an appropriate topic for this list. [/snip] The Oracle of PHP - 6 Degrees of Separation I joined PHP to Oracle, Kevin Bacon and temperature all in one shot. Tedd, what did you want to know about joins? :-) u made me laugh, makes me want grab a box of crayons and draw you a pretty picture. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
chris smith wrote: On Dec 1, 2007 3:53 PM, Crayon Shin Chan [EMAIL PROTECTED] wrote: On Saturday 01 December 2007, tedd wrote: At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote: On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. Really? Really. Considering the rest of the off-topic questions that regularly get asked on this list it's a bit much to single out this one particular post. javascript, css, html - none is directly related to php but all still get asked here (and 99% of the time answered) - I don't know why you're making such a big deal about this particular post and haven't kicked up a fuss about the rest in the past. you never with trolls. maybe it's because trolls eat Rocks[tm] and Tedd used to program in Rocks[tm] (which I presume left trolls with a shortage or something) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Join question
At 11:07 PM -0600 11/30/07, Jay Blanchard wrote: The Oracle of PHP - 6 Degrees of Separation I joined PHP to Oracle, Kevin Bacon and temperature all in one shot. Sounds like an omelette. :-) Tedd, what did you want to know about joins? I think I got it -- at least for the problem that was confronting me. Unfortunately, I was working on an older version of MySQL with limited functionality. But, trial and error paid off and I learned a lot in the process. Thanks for your support. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
On Nov 30, 2007 10:00 PM, tedd [EMAIL PROTECTED] wrote: At 2:00 PM +1100 11/30/07, Chris wrote: Out of curiosity, what SQL server (and version) are you using? I currently have MySQL 5.0.33 on my dev box and I had no problem with the query I gave you. Perhaps it's a version issue. There really shouldn't be a problem updating a table that also occurs in the select query since the select query should take place before the insert. He wasn't doing an insert/select, he was doing an update with two tables joined together. copy I thought that -- UPDATE user1 u1, user2 u2 SET u1.login = u2.login, u1.password = u2.password WHERE u1.username = u2.username -- would work, but it don't. Yes, that was true. But considering that it no longer worked, I moved on. I still have no clue as to why four months ago the code ran and now it doesn't -- other than the host upgraded. But, I don't see how that could have affected things. As for MySQL version, it's now 3.23.58 -- but I don't know what it was before the upgrade -- could have been the same. I dunno. Thanks for the interest. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It actually sounds like they may have downgraded. MySQL 4.x and 5.x shouldn't have a problem with the query, but 3.23 probably won't do it properly. If it's a cPanel host, they may have an old version of cPanel still running on the server, which would include the 3.23 option. If that is, in fact, the case jump ship. This will only be the first of many problems. And on a side note, wasn't 3.23 the first REAL stable version of MySQL accepted at large for production use? I think I recall playing around with 2.x, but it seems to me that, for the longest time, everyone was on 3.23. Am I perhaps simply having a premature senior moment? Happy December, by the way. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Nov 30, 2007 11:53 PM, Crayon Shin Chan [EMAIL PROTECTED] wrote: You ought to know by now that there is the php-db list. Even so your question doesn't belong even there because it has zilch to do with php, but it is still slightly more appropriate to post there than here. Put on your flame-retardant suit, umm flame retard. Over the course of several months, it's rare that I see you do anything but bitch and complain. I've never seen anyone have their period for a full year until I started reading your junk. You slap people for top-posting, complain about things being off-topic, criticize the newbies rather than educate, and overall make everyone wish that email had an ignore button, you ridiculous anime-obsessed child. This list is PHP-centric, yes but it's still a community. Hell, I think I speak more with some of the people on this list than I do my own pre-wife some days. In fact, I know I do! There are a great deal of highly-intelligent people on this list, so why not take advantage of that resource? Now, do you want to see something interesting? Go to Google and search for your email address. I found 81 results, most of which are duplicates. Now search for just the name parasane. It's a name I made up myself (registered, Copyrighted, et cetera), so it's all my stuff. I see 4,530 results in a wide variety of areas. Then feel free to search for Tedd Sperling in quotes so that you search for that exact name. Tedd's made his mark on at least the 1,930 results of which Google keeps track. So until you've been around enough to truly earn your right to tell someone far more accomplished than yourself to seek help elsewhere, do us all a favor and keep your God damned mouth shut. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote: On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. -- Crayon Really? No language lives in a vacuum, mate. Especially, a web language. IMO, one of the major attributes that make PHP truly great is MySQL. Over the years I've programmed in more languages than I can remember (including rocks), but never did I find a language that so easily integrated with a dB -- and that rocks, even if you don't realize it. So, I'll continue to post MySQL questions on this list because I think it's appropriate. I always include some mention/hint in the subject line as to the topic. So, if you see that it's a MySQL related question and you can't provide an answer, then you can pass and let others teach/learn without the noise. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
At 9:52 AM -0500 11/30/07, Daniel Brown wrote: On Nov 29, 2007 11:17 PM, Robert Cummings [EMAIL PROTECTED] wrote: Rob, The version difference is probably right on the nose. If I remember correctly, you couldn't do that in the long-popular 3.23, which *gasp!* is still used by some web hosts, believe it or not. -- Daniel P. Brown Bingo! You guys know you're stuff. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Saturday 01 December 2007, tedd wrote: At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote: On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. Really? Really. No language lives in a vacuum, mate. Especially, a web language. If you try you can probably make a connection from php to everything under the sun, doesn't mean everything under the sun is an appropriate topic for this list. So, I'll continue to post MySQL questions on this list because I think it's appropriate. You ought to know by now that there is the php-db list. Even so your question doesn't belong even there because it has zilch to do with php, but it is still slightly more appropriate to post there than here. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Friday 30 November 2007, Robert Cummings wrote: I'm sorry, allow me to rephrase... in the past 5 months you've made 2 on-topic useful posts, with the rest either being on-topic for an off-topic thread, or completely off-topic. I see no point in saying more, I've made my point. I know your drill by now - make wild generalised accusations without substance then say you've made your point. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Friday 30 November 2007, Jochem Maas wrote: my guess it took less time to search for 'Crayon' in his mail archive than it took you to write the sentence. Is not so much the actual time taken but rather that he had the free time at all. aparently Rob wasn't saying this ... but I would, regardless the OP (tedd) has earned his keep so to speak (and probably taken more shit than you in the process without resorting to troll-like behaviour) - this is proved by the fact that people like Rob are helping him with something that is not strictly on topic. So let me get this straight, only paid up members of the old boys club are allowed to make off-topic posts? The rest can lump it? besides which it's rather pointless telling someone to go elsewhere for help when they already got the help and posted that they had solved the problem. That's for future reference. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Join question
[snip] If you try you can probably make a connection from php to everything under the sun, doesn't mean everything under the sun is an appropriate topic for this list. [/snip] The Oracle of PHP - 6 Degrees of Separation I joined PHP to Oracle, Kevin Bacon and temperature all in one shot. Tedd, what did you want to know about joins? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
At 12:53 PM +0800 12/1/07, Crayon Shin Chan wrote: On Saturday 01 December 2007, tedd wrote: At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote: On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. Really? Really. No language lives in a vacuum, mate. Especially, a web language. If you try you can probably make a connection from php to everything under the sun, doesn't mean everything under the sun is an appropriate topic for this list. So, I'll continue to post MySQL questions on this list because I think it's appropriate. You ought to know by now that there is the php-db list. Even so your question doesn't belong even there because it has zilch to do with php, but it is still slightly more appropriate to post there than here. Well said. Cheers, tedd (that should confuse the post-police for a while). -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
That it is, Steve. That it is. And because of the occasion, I feel justified in celebrating by top-posting. TFGIF! On Nov 30, 2007 12:58 PM, Steve Edberg [EMAIL PROTECTED] wrote: At 10:30 AM -0500 11/30/07, Daniel Brown wrote: On Nov 30, 2007 10:22 AM, Jochem Maas [EMAIL PROTECTED] wrote: Daniel Brown wrote: I was tempted to flame Tedd just because he's Tedd. ;-P lol. but then the guy was programming Rocks(tm) way before I was born, that has to count for something :-) Please keep all replies on the list, Jochem. ;-P HA! It was too good not to share. Programming Rocks you say? It's not that old... http://www.rocksclusters.org/wordpress/ :) It appears to be a Friday... - steve -- +--- my people are the people of the dessert, ---+ | Steve Edberghttp://pgfsun.ucdavis.edu/ | | UC Davis Genome Center[EMAIL PROTECTED] | | Bioinformatics programming/database/sysadmin (530)754-9127 | + said t e lawrence, picking up his fork + -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
At 2:00 PM +1100 11/30/07, Chris wrote: Out of curiosity, what SQL server (and version) are you using? I currently have MySQL 5.0.33 on my dev box and I had no problem with the query I gave you. Perhaps it's a version issue. There really shouldn't be a problem updating a table that also occurs in the select query since the select query should take place before the insert. He wasn't doing an insert/select, he was doing an update with two tables joined together. copy I thought that -- UPDATE user1 u1, user2 u2 SET u1.login = u2.login, u1.password = u2.password WHERE u1.username = u2.username -- would work, but it don't. Yes, that was true. But considering that it no longer worked, I moved on. I still have no clue as to why four months ago the code ran and now it doesn't -- other than the host upgraded. But, I don't see how that could have affected things. As for MySQL version, it's now 3.23.58 -- but I don't know what it was before the upgrade -- could have been the same. I dunno. Thanks for the interest. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Nov 30, 2007 10:22 AM, Jochem Maas [EMAIL PROTECTED] wrote: Daniel Brown wrote: I was tempted to flame Tedd just because he's Tedd. ;-P lol. but then the guy was programming Rocks(tm) way before I was born, that has to count for something :-) Please keep all replies on the list, Jochem. ;-P HA! It was too good not to share. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Join question
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Saturday, December 01, 2007 2:09 AM To: Crayon Shin Chan; php-general@lists.php.net Subject: Re: [PHP] Join question At 12:53 PM +0800 12/1/07, Crayon Shin Chan wrote: On Saturday 01 December 2007, tedd wrote: At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote: On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. Really? Really. No language lives in a vacuum, mate. Especially, a web language. If you try you can probably make a connection from php to everything under the sun, doesn't mean everything under the sun is an appropriate topic for this list. So, I'll continue to post MySQL questions on this list because I think it's appropriate. You ought to know by now that there is the php-db list. Even so your question doesn't belong even there because it has zilch to do with php, but it is still slightly more appropriate to post there than here. Well said. Cheers, tedd (that should confuse the post-police for a while). -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I can only say as someone over here said once... Do not enter into the world of drugs. We are too many and there's not enough for everyone (Les Luthiers) lol Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
tedd [EMAIL PROTECTED] wrote: Hi gang: I found why the JOIN didn't work for me in this instance, which was I needed to create a third table and JOIN what I needed in that table from the other two. My problem was that I was trying to alter one of the tables in the JOIN. While that might be possible it didn't appear so in my current problem. Thanks for letting me bounce ideas off you peoples. Cheers, tedd Glad you found an answer tedd, I was going to start digging through my old MySQL stuff and see what I could dig up, it's been a couple of years since doing any DB work that needed any of that. Looks like the language and fun have changed since then! Gotta love improvements. Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Nov 30, 2007 8:08 AM, Jochem Maas [EMAIL PROTECTED] wrote: Crayon Shin Chan wrote: On Friday 30 November 2007, Robert Cummings wrote: That's an amusing statement. I took a peek back in time and noticed that in the past 5 months you've only made two on-topic useful posts to the PHP General list-- and they were both for the same thread. If you have that much free time on your hands, should you not be looking for my off-topic posts so you can prove a point? my guess it took less time to search for 'Crayon' in his mail archive than it took you to write the sentence. Or are you saying that one needs to make a lot of on-topic posts to build up credit in order to be able to make off-topic posts? aparently Rob wasn't saying this ... but I would, regardless the OP (tedd) has earned his keep so to speak (and probably taken more shit than you in the process without resorting to troll-like behaviour) - this is proved by the fact that people like Rob are helping him with something that is not strictly on topic. besides which it's rather pointless telling someone to go elsewhere for help when they already got the help and posted that they had solved the problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I was tempted to flame Tedd just because he's Tedd. ;-P -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
On Nov 29, 2007 11:17 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-11-30 at 14:00 +1100, Chris wrote: Out of curiosity, what SQL server (and version) are you using? I currently have MySQL 5.0.33 on my dev box and I had no problem with the query I gave you. Perhaps it's a version issue. There really shouldn't be a problem updating a table that also occurs in the select query since the select query should take place before the insert. He wasn't doing an insert/select, he was doing an update with two tables joined together. He was doing an update/select and an insert/select. And the query I sent performed the insert/select without problem on my system. A similar query would have done the update/select. The fact that the select portion required a join doesn't change anything. copy I thought that -- UPDATE user1 u1, user2 u2 SET u1.login = u2.login, u1.password = u2.password WHERE u1.username = u2.username -- would work, but it don't. Wrong query for either of the needs :) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Rob, The version difference is probably right on the nose. If I remember correctly, you couldn't do that in the long-popular 3.23, which *gasp!* is still used by some web hosts, believe it or not. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
Crayon Shin Chan wrote: On Friday 30 November 2007, Robert Cummings wrote: That's an amusing statement. I took a peek back in time and noticed that in the past 5 months you've only made two on-topic useful posts to the PHP General list-- and they were both for the same thread. If you have that much free time on your hands, should you not be looking for my off-topic posts so you can prove a point? my guess it took less time to search for 'Crayon' in his mail archive than it took you to write the sentence. Or are you saying that one needs to make a lot of on-topic posts to build up credit in order to be able to make off-topic posts? aparently Rob wasn't saying this ... but I would, regardless the OP (tedd) has earned his keep so to speak (and probably taken more shit than you in the process without resorting to troll-like behaviour) - this is proved by the fact that people like Rob are helping him with something that is not strictly on topic. besides which it's rather pointless telling someone to go elsewhere for help when they already got the help and posted that they had solved the problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Dec 1, 2007 3:53 PM, Crayon Shin Chan [EMAIL PROTECTED] wrote: On Saturday 01 December 2007, tedd wrote: At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote: On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. Really? Really. Considering the rest of the off-topic questions that regularly get asked on this list it's a bit much to single out this one particular post. javascript, css, html - none is directly related to php but all still get asked here (and 99% of the time answered) - I don't know why you're making such a big deal about this particular post and haven't kicked up a fuss about the rest in the past. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
Daniel Brown wrote: On Nov 30, 2007 10:22 AM, Jochem Maas [EMAIL PROTECTED] wrote: Daniel Brown wrote: I was tempted to flame Tedd just because he's Tedd. ;-P lol. but then the guy was programming Rocks(tm) way before I was born, that has to count for something :-) Please keep all replies on the list, Jochem. ;-P crap - guess I hit reply instead of 'reply all' by mistake. HA! It was too good not to share. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
At 10:30 AM -0500 11/30/07, Daniel Brown wrote: On Nov 30, 2007 10:22 AM, Jochem Maas [EMAIL PROTECTED] wrote: Daniel Brown wrote: I was tempted to flame Tedd just because he's Tedd. ;-P lol. but then the guy was programming Rocks(tm) way before I was born, that has to count for something :-) Please keep all replies on the list, Jochem. ;-P HA! It was too good not to share. Programming Rocks you say? It's not that old... http://www.rocksclusters.org/wordpress/ :) It appears to be a Friday... - steve -- +--- my people are the people of the dessert, ---+ | Steve Edberghttp://pgfsun.ucdavis.edu/ | | UC Davis Genome Center[EMAIL PROTECTED] | | Bioinformatics programming/database/sysadmin (530)754-9127 | + said t e lawrence, picking up his fork + -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Thu, 2007-11-29 at 15:41 -0500, tedd wrote: Hi gang: I'm trying to understand joins, Here's the situation. I have two tables (user1, user2) in one database: The common field between the two tables is username. I want to take fields login and password from user2 and populate the same fields in user1. Currently, the table user1 has 5303 entries, whereas user2 has 5909. What I want at the end of this is for table user1 to have the same number of entries as table user2. Now, how do I set up the query? INSERT INTO table1 ( login, password ) SELECT T2.login, T2.password FROM table2 AS T2 LEFT JOIN table1 as T1 ON T1.login = T2.login WHERE T1.login IS NULL; That should do it... off the top of my head :) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Nov 29, 2007 3:41 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: Hi, Tedd. PS: Side note -- will safe_mode ON cause problems with this? Negative. I can't see any reason to even think so. All safe_mode does is check the UID/GID of the script to make sure it matches that of the target file you're attempting to open. Socket connections don't count. In the next few years, it won't make a difference, since safe_mode has been removed as of PHP 6.0.0. I believe the only components of that to remain will be the open_basedir (which I think moves from PHP_INI_SYSTEM to PHP_INI_ALL) and the disable_* parts. Don't quote me on that, though, since I'm too lazy to go look it up right now. ;-P -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
tedd [EMAIL PROTECTED] wrote: Hi gang: I'm trying to understand joins, Here's the situation. I have two tables (user1, user2) in one database: The common field between the two tables is username. I want to take fields login and password from user2 and populate the same fields in user1. Currently, the table user1 has 5303 entries, whereas user2 has 5909. What I want at the end of this is for table user1 to have the same number of entries as table user2. Now, how do I set up the query? TIA for any suggestions. Cheers, tedd PS: Side note -- will safe_mode ON cause problems with this? You should be only joined on entries with the same amounts, so if username george is in both, it should join. However if username george_by_george only exists in table 2, then you don't get a join happening. What you would instead want to do is run a loop through the second table and grep the username against the first table. If it exists, give them command to write table2.pass into table1.pass If it doesn't exist you want to write table2.user and table2.pass into table1 HTH, Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Thu, 2007-11-29 at 15:47 -0500, Wolf wrote: tedd [EMAIL PROTECTED] wrote: Hi gang: I'm trying to understand joins, Here's the situation. I have two tables (user1, user2) in one database: The common field between the two tables is username. I want to take fields login and password from user2 and populate the same fields in user1. Currently, the table user1 has 5303 entries, whereas user2 has 5909. What I want at the end of this is for table user1 to have the same number of entries as table user2. Now, how do I set up the query? TIA for any suggestions. Cheers, tedd PS: Side note -- will safe_mode ON cause problems with this? You should be only joined on entries with the same amounts, so if username george is in both, it should join. However if username george_by_george only exists in table 2, then you don't get a join happening. What you would instead want to do is run a loop through the second table and grep the username against the first table. If it exists, give them command to write table2.pass into table1.pass If it doesn't exist you want to write table2.user and table2.pass into table1 Grep? Loop? A single query will suffice. Also, he doesn't mention wanting to clobber the passwords in table1 when the username does already exist. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
At 4:11 PM -0500 11/29/07, Robert Cummings wrote: Grep? Loop? A single query will suffice. Also, he doesn't mention wanting to clobber the passwords in table1 when the username does already exist. Cheers, Rob. Table1 passwords and logins are not populated. I want to take those appearing in Table2 and place them in Table1. Then, I need to take all the entries that are in Table2, but not in Table2, and add them to Table1. I think (could be wrong) it's going to be a two pass operation. First, to transfer values to records in the target table (user1) that have common username with the source table (user2); Second, to add records from the source table (user2) that don't are not found in the target table (user1). user1 Table username -- common to both tables login -- needs to be populated password -- needs to be populated user2 Table username -- common to both tables login -- has data password -- has data I thought that -- UPDATE user1 u1, user2 u2 SET u1.login = u2.login, u1.password = u2.password WHERE u1.username = u2.username -- would work, but it don't. Once I can transfer the known data, then I can work on increasing the number of entries that are found in user2 but are absent in user1. Still floundering. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
Hi gang: I found why the JOIN didn't work for me in this instance, which was I needed to create a third table and JOIN what I needed in that table from the other two. My problem was that I was trying to alter one of the tables in the JOIN. While that might be possible it didn't appear so in my current problem. Thanks for letting me bounce ideas off you peoples. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Friday 30 November 2007, Robert Cummings wrote: That's an amusing statement. I took a peek back in time and noticed that in the past 5 months you've only made two on-topic useful posts to the PHP General list-- and they were both for the same thread. If you have that much free time on your hands, should you not be looking for my off-topic posts so you can prove a point? Or are you saying that one needs to make a lot of on-topic posts to build up credit in order to be able to make off-topic posts? -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Fri, 2007-11-30 at 10:21 +0800, Crayon Shin Chan wrote: On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. That's an amusing statement. I took a peek back in time and noticed that in the past 5 months you've only made two on-topic useful posts to the PHP General list-- and they were both for the same thread. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
On Thu, 2007-11-29 at 18:43 -0500, tedd wrote: Hi gang: I found why the JOIN didn't work for me in this instance, which was I needed to create a third table and JOIN what I needed in that table from the other two. My problem was that I was trying to alter one of the tables in the JOIN. While that might be possible it didn't appear so in my current problem. Out of curiosity, what SQL server (and version) are you using? I currently have MySQL 5.0.33 on my dev box and I had no problem with the query I gave you. Perhaps it's a version issue. There really shouldn't be a problem updating a table that also occurs in the select query since the select query should take place before the insert. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
Out of curiosity, what SQL server (and version) are you using? I currently have MySQL 5.0.33 on my dev box and I had no problem with the query I gave you. Perhaps it's a version issue. There really shouldn't be a problem updating a table that also occurs in the select query since the select query should take place before the insert. He wasn't doing an insert/select, he was doing an update with two tables joined together. copy I thought that -- UPDATE user1 u1, user2 u2 SET u1.login = u2.login, u1.password = u2.password WHERE u1.username = u2.username -- would work, but it don't. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Fri, 2007-11-30 at 11:00 +0800, Crayon Shin Chan wrote: On Friday 30 November 2007, Robert Cummings wrote: That's an amusing statement. I took a peek back in time and noticed that in the past 5 months you've only made two on-topic useful posts to the PHP General list-- and they were both for the same thread. If you have that much free time on your hands, should you not be looking for my off-topic posts so you can prove a point? Took me 60 seconds. I don't delete my emails. Or are you saying that one needs to make a lot of on-topic posts to build up credit in order to be able to make off-topic posts? No, I'm merely pointing out the hypocrisy. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question [solved]
On Fri, 2007-11-30 at 14:00 +1100, Chris wrote: Out of curiosity, what SQL server (and version) are you using? I currently have MySQL 5.0.33 on my dev box and I had no problem with the query I gave you. Perhaps it's a version issue. There really shouldn't be a problem updating a table that also occurs in the select query since the select query should take place before the insert. He wasn't doing an insert/select, he was doing an update with two tables joined together. He was doing an update/select and an insert/select. And the query I sent performed the insert/select without problem on my system. A similar query would have done the update/select. The fact that the select portion required a join doesn't change anything. copy I thought that -- UPDATE user1 u1, user2 u2 SET u1.login = u2.login, u1.password = u2.password WHERE u1.username = u2.username -- would work, but it don't. Wrong query for either of the needs :) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Friday 30 November 2007, Robert Cummings wrote: Or are you saying that one needs to make a lot of on-topic posts to build up credit in order to be able to make off-topic posts? No, I'm merely pointing out the hypocrisy. That would only be true if I had been making off-topic posts. But so far all you have concluded is that during the last 5 months I have only made two on-topic useful posts. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Join question
On Fri, 2007-11-30 at 13:49 +0800, Crayon Shin Chan wrote: On Friday 30 November 2007, Robert Cummings wrote: Or are you saying that one needs to make a lot of on-topic posts to build up credit in order to be able to make off-topic posts? No, I'm merely pointing out the hypocrisy. That would only be true if I had been making off-topic posts. But so far all you have concluded is that during the last 5 months I have only made two on-topic useful posts. I'm sorry, allow me to rephrase... in the past 5 months you've made 2 on-topic useful posts, with the rest either being on-topic for an off-topic thread, or completely off-topic. I see no point in saying more, I've made my point. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php