#mysql
24 October 2007
Total 29 pages. You are browsing page 2/29.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
00:14 <****> ok.
00:14 <****> setuid: alter table wp_post_back add column t_md5 varchar(32);
00:14 <****> Query OK, 410 rows affected (0.50 sec)
00:15 <****> update wp_post_back set t_md5 = md5(`post_content`);
00:15 <****> i think it was called post_content
00:15 <****> Same: Query OK, 410 rows affected (0.28 sec)
00:15 * kkruit thinks yes chadmaynard has actualy done it!!!
00:15 * Gushie crosses fingers
00:15 <****> setuid: alter table wp_post_back add unique(t_md5); <- check for dupes
00:16 <****> kkruit: whats ? i missed some posts :)
00:16 <****> please, I need a little help.. I have a field with a date in a string format "10/22/2007" that needs to be change to a date field in the "2007-10-22" format, I need to do this for all 60,000 records in the table
00:16 <****> Billium: use date and time functions
00:16 <****> Billium: make a backup :]
00:16 <****> er...
00:16 <****> I created a new field, and made it a date type
00:16 <****> setuid: what?
00:16 <****> longin: no question just pure excitement
00:16 <****> now need to sql over the other to it but don't wanna mess up
00:17 <****> select * from wp_post_back where t_md5='d41d8cd98f00b204e9800998ecf8427e';
00:17 <****> kkruit: :-)
00:17 <****> 45 rows in set (0.79 sec)
00:17 <****> setuid: do you have duplicates?
00:17 <****> Because:
00:17 <****> alter table wp_post_back add unique(t_md5);
00:17 <****> ERROR 1062 (23000): Duplicate entry 'd41d8cd98f00b204e9800998ecf8427e' for key 2
00:17 <****> setuid: are those 45 all the same post?
00:17 <****> update table set newdate = date('Y-m-d', strtotime(olddate)) where 1 didn't work
00:17 <****> Odd that they're dupes, because they're completely different posts
00:17 <****> sec.
00:18 <****> Hi all. I don't know much about mysql, but I need to drop a table and it won't let me due to foreign key constraints. How can I tell which table has the foreign key constraint and remoe it, etc?
00:18 <****> setuid: go ahead and INSERT IGNORE INTO wp_posts SELECT * FROM wp_post_back
00:18 <****> see what you end up with
00:18 <****> chadmaynard, http://rafb.net/p/aH6MBH74.html
00:19 <****> INSERT IGNORE INTO wp_posts SELECT * FROM wp_post_back;
00:19 <****> Query OK, 151 rows affected (0.16 sec)
00:20 <****> setuid: run that same query but LEFT(post_content, 30) instead
00:20 <****> lovely: http://rafb.net/p/NtiLmp14.html
00:21 <****> setuid: so you had blank posts....
00:21 <****> Apparently so... how weird.
00:21 <****> Since I specifically don't insert unless the array has data
00:21 <****> setuid: anyway, drop table wp_post_back;
00:21 <****> setuid: SELECT version();
00:22 <****> | 5.0.32-Debian_7etch1 |
00:22 <****> you can create a trigger to build the MD5 on insert if you don't want to edit the wordpress code.
00:22 <****> assuming you haven't already done so
00:23 <****> helps for upgrades no doubt
00:23 <****> I haven't touched the core code
00:23 * kkruit applauds
00:23 <****> And I have no idea how to use, or what triggers are. I've never had to use them.
00:23 <****> triggers are the shit
00:23 <****> hi guys
00:23 * chadmaynard walks away
00:24 <****> I'm going to dump and reload this, and try some clean imports... I guess I need to do the checking/deleting, before I do my initial inserts anyway though, if I alter the table structure.
00:24 <****> setuid: Well you have 3 choices. You create a trigger, you change the wordpress code, or you drop the md5 column/key...
00:24 <****> I thought there was some mysql incantation to delete duplicate rows o
00:24 <****> f content
00:24 <****> I have an autoincrementing INT primary column, I need a dirty hack (temporary) that will allow me to query for strings 'ABxxxx' which will return me the row with a primary key value of xxxxx
00:24 <****> setuid: Otherwise you'll get errors as soon as someone tries to add records, since all the new values in this column will be blank!
00:25 <****> is it possible? (if this makes sense at all)
00:26 <****> ribasushi: woudl SUBSTRING() help?
00:26 <****> *would
00:29 <****> ribasushi: how do we find xxx in that string?
00:29 <****> re
00:30 <****> um I didn't ask correctly
00:31 <****> basically can I make a "virtual" column (procedures they are called?) which when queried for ABxxxx will re-query with pk = xxxx, and return the row
00:31 <****> I can not change the select - I am not the one issuing it
00:31 <****> I can only say against which column it goes
00:31 <****> and I want to avoid massive database changes
00:32 <****> make a view with the pk column as CONCAT('AB', pkcol);
00:33 <****> ok, got to read up on views then
00:33 <****> CREATE VIEW newView AS SELECT CONCAT('AB', pkcol) AS pkcol, ..... FROM table.;
00:33 <****> easy
00:33 <****> then that view will look just like a table
00:34 <****> you can insert into materialized view if you need that
00:34 <****> Is there a way to do a 'select *' and exclude a column?
00:34 <****> setuid: list the columns you want
00:34 <****> instead of select a,b,c,d,e,f,g...
00:34 <****> chadmaynard, Right, but that's a lot of columns ;)
00:34 <****> chadmaynard: ahhh so it basically becomes a new table from the clients point of view
00:34 <****> can someone help me figure out why my LAMP server is giving me problems? the PHP guys can't figure it out
00:34 <****> setuid: what's wrong with list?
00:34 <****> chadmaynard: and any update to the physical table will be reflected in the view
00:34 <****> ribasushi: yes
00:34 <****> chadmaynard: brilliant
00:35 <****> JeevesMoss: the PHP guys are slow.
00:35 <****> chadmaynard: are views persistent or are they lost upon restarting mysql?
00:35 <****> ribasushi: persistant
00:35 <****> chadmaynard: that's one way of puttng it. I had to blow away my Apache2 server (bad install), and now I have to rebuild it. I can't get it to serve up my pages corectly.
00:35 <****> This is a pain in the ass
00:36 <****> JeevesMoss: your PHP pages?
00:36 <****> setuid: maybe you should choose a new career?
00:36 <****> ha ha
00:36 <****> No, the problem is futzing with bad php code, written by kids
00:36 <****> chadmaynard: the site is built on a LAMP server, and the URL is www.penn-tawsha.net I had to reinstall everything, so I came here to get some straight help on making sure that I have the MySQL parts installed corectly
00:37 <****> JeevesMoss: enable error reporting and display errors in php.ini
00:37 <****> chadmaynard: I know the MySQL server is up and running (can connect to it remotly via a GUI program, it's just not behaving with PHP)
00:37 <****> and restart the apache server
00:38 <****> JeevesMoss: looks like the php-mysql connector isn't installed. Errors will confirm that
00:38 <****> JeevesMoss did you install php-mysql?
00:38 <****> Still stuck in a catch-22 with post_title vs. post_content and setting a unique value on that column... either I truncate, or I dupe data.
Total 29 pages. You are browsing page 2/29.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
