IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1992.92 MB
Powered by
Channel Info
Network: freenodeChannel: #mysql |
Search in www.irclog.org
Log from #mysql at freenode 2006-08-01
[03:40]<xra>CollinY2K: Better now?
[03:40]<cjffygyqk>Not sure, it doesn't want to go through
[03:41]<xra>CollinY2K: You see an error?
[03:41]<cjffygyqk>No, when I go to run it, it just sits there saying it's waiting
[03:41]<xra>CollinY2K: How large is this table?
[03:42]<fugrlxdvn>hello
[03:42]<cjffygyqk>Um...quite large, not sure on specifics, I can check
[03:43]<xra>CollinY2K: SELECT COUNT(*) FROM sold;
[03:43]<cjffygyqk>121,000 rows at the moment
[03:43]<xra>CollinY2K: Is product indexed?
[03:43]<cjffygyqk>hm?
[03:44]<xra>CollinY2K: Do you have an index on the product field?
[03:44]<cjffygyqk>let me check
[03:44]<fugrlxdvn>if i'm adding a new record to a table that contains an auto-incrementing field, how can i find out what value mysql put in that field?
[03:45]<cjffygyqk>yea, it is
[03:45]<xra>lunaphyte: See: last_insert_id() function.
[03:45]<xra>CollinY2K: Try looking at the EXPLAIN output of that SQL.
[03:45]<rav>I keep trying to start mysql and I keep getting this error http://paste.seagullproject.org/38
[03:45]<rav>anyone know what could cause it
[03:46]<xra>!perror 2
[03:46]<sql>System error: 2 = No such file or directory
[03:46]<xra>ajt: There's a good chance your MySQL server is not started.
[03:46]<cjffygyqk>It's not going through, I click Go and it just sites there
[03:46]<cjffygyqk>*sits
[03:47]<rav>Xgc: that's what I'm trying to do is start it
[03:47]<xra>CollinY2K: If you can provide the mysqldump of that table (gzipped) somewhere, I'll check it out.
[03:47]<rav>When I try to start it I get that error
[03:47]<cjffygyqk>alright
[03:48]<cjffygyqk>oh it went through this last time
[03:48]<xra>ajt: Check the error log.
[03:48]<fugrlxdvn>Xgc: thanks. does that handle instances where multiple inserts are happening simultaneously ok?
[03:48]<xra>lunaphyte: Yes. The function is connection specific.
[03:48]<fugrlxdvn>perfect. thanks.
[03:48]<xra>lunaphyte: Other inserts associated with other connections will not impact you.
[03:49]<xra>lunaphyte: You're welcome.
[03:49]<rav>Xgc: empty
[03:49]<cjffygyqk>It looks like it worked but I'm not totally sure cause I'm used to having where statements in to limit it for user. Let me add those so I can see it with numbers I'm used to
[03:50]<cjffygyqk>Do I need to add the Where statements to each part or just the last one?
[03:50]<xra>ajt: If the server is failing to start, there's likely an error somewhere.
[03:50]<xra>CollinY2K: What criteria is in this WHERE clause>
[03:50]<cjffygyqk>uid = $user->uid AND product = $product
[03:51]<xra>CollinY2K: Why are you grouping by product if there is only one product?
[03:51]<cjffygyqk>I have a while loop
[03:51]<cjffygyqk>going through them
[03:51]<cjffygyqk>then displaying
[03:51]<xra>CollinY2K: Listen closely.
[03:51]<rav>Xgc: Jul 31 20:44:44 localhost mysqld[30539]: 060731 20:44:44 [ERROR] Can't start server: cannot resolve hostname!: Success
[03:52]<xra>CollinY2K: If you have a WHERE clause that is explicitly filtering only one product, why are you using GROUP BY product?
[03:52]<xra>CollinY2K: Your query will run much much faster if you avoid that.
[03:53]<cjffygyqk>Um...
[03:53]<xra>CollinY2K: Ok. If you don't understand, don't worry about it.
[03:53]<cjffygyqk>I'm only displaying the products once per price
[03:53]<cjffygyqk>so I need the rest group if they are the same price
[03:53]<xra>CollinY2K: That's ok. Don't worry about it.
[03:54]<xra>CollinY2K: You can add the WHERE criteria to each derived table or to the WHERE clause of the outer most SELECT.
[03:55]<cjffygyqk>so right before Order By?
[03:55]<xra>CollinY2K: Your SQL may run much slower than it might if you could understand my comments above.
[03:55]<xra>CollinY2K: Yes.
[03:55]<-- sxyvn-j xrs fuyv>you")
[03:56]<xra>CollinY2K: I suspect you have an application logic mistake. Your description sounds like you are issuing this SQL within a loop.
[03:56]<vxg_pzufcggzvjz>Hey guys, I am trying to get MySQL running on my machine just to do some testing with Wordpress, and I keep getting the error: #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
[03:56]<xra>CollinY2K: That would seem to be a mistake and also why your application took so long to complete.
[03:57]<cjffygyqk>#1054 - Unknown column 'uid' in 'where clause'
[03:57]<cjffygyqk>I'm testing it in the database, not in the php. So there is no loop there
[03:57]<xra>CollinY2K: There's no UID in this table.
[03:57]<cjffygyqk>Yes there is...
[03:57]<xra>CollinY2K: Your database doesn't agree.
[03:58]<vxg_pzufcggzvjz>any ideas of what i should do?
[03:58]<cjffygyqk>lol I see that
[03:58]<cjffygyqk>Let me export this table and send it to you
[03:58]<xra>CollinY2K: You need to select that in your derived tables.
[03:58]<xra>CollinY2K: I would add that WHERE clause to each derived table.
[03:58]<xra>CollinY2K: The SQL will run much faster.
[03:59]<xra>CollinY2K: You only want the output associated with a specific user, correct?
[04:01]<cjffygyqk>yes
[04:01]<cjffygyqk>Okay, I got it to work in SQL
[04:01]<cjffygyqk>looks exactly how I want
[04:01]<xra>CollinY2K: You're welcome.
[04:02]<cjffygyqk>Yes, thank you very much (although my problems may not be done yet)
[04:09]<cjffygyqk>www.neohangout.com/temp.txt
[04:09]<cjffygyqk>that's the current php page I have with this
[04:10]<cjffygyqk>I have problems with the loop entering the data. Probably not pointing correcting as the table is showing text like ".product" instead of product name...same for counts.
[04:11]<cjffygyqk>As you said before though, I probably dont need to loop. I just did that because that's how I've done things in the past in order to formating
[04:13]<cjffygyqk>ohhh, I'm an idiot
[04:14]<cjffygyqk>or wait no...I have no idea
[04:16]<xra>CollinY2K: Did you try $info->product
[04:16]<cjffygyqk>no... I had $info->v1.product
[04:16]<xra>CollinY2K: I don't use PHP. That's just a guess.
[04:17]<xra>CollinY2K: Did you try $info->product ?
[04:17]<xra>CollinY2K: Hint: Maybe you could try that.
[04:18]<cjffygyqk>but I'd still have to specify table for count...
[04:18]<cjffygyqk>since two counts with same name
[04:18]<xra>CollinY2K: No. Use an alias.
[04:18]<xra>CollinY2K: SELECT v1.product product, v1.price price, v1.count cnt1, v2.count cnt2 FROM ...
[04:19]<xra>CollinY2K: Use the aliases when grabbing the data.
[04:19]<xra>CollinY2K: I don't know if that's the issue. But there's some strange PHP action going on.
[04:20]<cjffygyqk>yea, that fixed product and I forgot about the aliases so that should fix that part too...
[04:20]<xra>CollinY2K: *nod*
[04:24]<cjffygyqk>All works perfectly now. Thanks a TON!







