Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#mysql

09 November 2007


Total 27 pages. You are browsing page 1/27.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last

--- Log opened Fri Nov 09 00:00:27 2007
00:01 <****> btw flush status; is what i was looking for
00:01 <****> i kept wondering why flush stats; didnt work
00:02 <****> mikegriffin_, you're scary
00:02 <****> ...
00:03 <****> you are disturbing the space/time continium, and cause the servers to netsplit
00:12 <****> hi
00:13 <****> what query would I run if I wanted to find out whether column col in table foo in database bar had a foreign key restraint and what it is?
00:13 <****> I am using django that translate everything into unicode map. I can guess I am having problem with my database. Does anyone know what I should set up in order to get that working?
00:14 <****> google for "asking smart questions"
00:14 <****> alguem do brasil
00:15 <****> Anyone know where foreign key constraints are stored in a mysql db?
00:15 <****> jbalint, are you referencing myself?
00:16 <****> wfq_: yes
00:16 <****> Ktron: show indexes from x; show create table x; or query the INFORMATION_SCHEMA
00:16 <****> hello
00:16 <****> Ktron: most likely the frm file as its in the create table
00:17 <****> i would like to have a unique name when i select two like-wise named fields, like: SELECT * from table1,table2
00:17 <****> mikegriffin_, jbalint, I'm been trying to find it in the information_schema... I might have found it, but I don't think so
00:18 <****> there are two fields that are equal, and the only option i know is to call all fields , like SELECT field1 as foo, field2 from table1,table2
00:18 <****> mikegriffin_, jbalint, I can't find PRIMARY KEY and UNIQUE constraints, just not FOREIGN KEy
00:21 <****> phrearch_ your options are limited; if two fields in separate tables have the same name, then they have the same name
00:21 <****> how about:
00:21 <****> SELECT #__jSLplus_profiles.birth_dt AS profilebirth,* FROM #__jSLplus_profiles,#__jSLplus_avatars WHERE #__jSLplus_profiles.profile_id = #__jSLplus_avatars.id';
00:21 <****> or should i just call every field in the table?
00:21 <****> jbalint, show indexes from table doesn't seem to work either
00:22 <****> the * doesn't work , as it selects everything - what information do you wish to retrieve ?
00:22 <****> i was hoping that i could limit the query line with the *
00:22 <****> everything from both tables
00:22 <****> no, it never limits it - it includes all fields
00:22 <****> where birth_dt is the field that occurs in both tables
00:22 <****> jbalint, nevermind, maybe it didn't save?
00:22 <****> phrearch_ rename the field in one of the tables; an issue like this often indicates a suboptimal design
00:22 <****> save what. did you get an error 150?
00:23 <****> are you using innodb?
00:23 <****> you're right
00:23 <****> i just thought about that. it's bad naming
00:23 <****> thanks
00:23 <****> phrearch_ the obvious solution is to prefix all fields with a table identifier
00:23 <****> how would you call the creation data of a profile?
00:23 <****> not always pretty, but very, very clear
00:24 <****> createdate, obviously
00:24 <****> hm yes
00:24 <****> birthday
00:24 <****> wow
00:24 <****> if there is another table that also has a create date column in it, use profile_create_date
00:24 <****> yes, freenode is sickly
00:24 <****> jbalint, bleh
00:24 <****> i see
00:24 <****> what is the date in the second table ?
00:25 <****> its the date an avatar was created in second life
00:25 <****> well, more date time
00:25 <****> if it's also a profile create date then your tables are horribly badly designed
00:25 <****> no, its the birthdate of an avatar
00:25 <****> thats not the same thing
00:25 <****> heh, I was joking about birthday, but now it seems it does fit. heh
00:25 <****> i took care not to have anything double in the table design
00:26 <****> so use profilecreated and avatarbirth as the fieldnames, it's not rocket science...
00:26 <****> ok, makes sense. thanks. I just needed some fresh thoughs
00:26 <****> t
00:26 * adaptr births dkr
00:26 * phrearch_ is coding for +10 hours now
00:26 <****> jbalint, trying to check... I'm not sure how to figure out what engine I'm using
00:26 <****> oh man
00:26 <****> SQL design is not coding!
00:26 <****> frack that
00:27 <****> jbalint, the engine is MyISAM
00:28 <****> coding is messy.. database design is pure logic... pure as teh driven snowsh!
00:28 <****> Ktron: then you dont have foreign keys
00:29 <****> jbalint, yeah, you're right
00:29 <****> jbalint, I misread it, I thought everything except for innodb had foreign keys
00:30 <****> /*!50000 SELECT TABLE_NAME from information_schema.TABLES where ENGINE='InnoDB' */;
00:32 <****> Is there anyway to set a mysql variable and also have a query in the same call with PHP? I don't want to do two queries with pconnect because I can't guarantee that the same user will get the same persistent connection back.
00:34 <****> since the mysql command separator is a semi-colon, I suppose you could - but ISTR that PHP doesn't support it
00:34 <****> ya, what a PITA. I wish it did because it would make this problem so much simpler
00:34 <****> isnull(sum(t1.am,0))
00:35 <****> how could the sum of 0 + something ever be null?
00:35 <****> that would be "no"
00:35 <****> or, rather, it would always evaluate to false
00:35 <****> t1.am = the-NULLinator
00:35 <****> well there are no records in t1 and its causing errors
00:35 <****> heh
00:35 <****> "I'll be NULL"
00:36 <****> yadayada *what* is causing errors ?
00:36 <****> i have two fields from two diff tables being summed and then subtracted from eachother
00:36 <****> but if there are no records in one of the tables it returns nothing when it is subtracted
00:36 <****> NULL
00:37 <****> summing nothing returns NULL instead of zero, very dumb
00:38 <****> so i tried to use the isnull on both of the summed fields, but now the whole thing is not worknig
00:38 <****> well, yes- you'll have to actually check each of them, of course
00:39 <****> check? with iif's?
00:39 <****> yadayada: ifnull(`col`, 0)
00:40 <****> ifnull? hmm i was using isnull
00:40 <****> let me try
00:40 <****> I'm running mysql server outside a chroot, and trying to connect to it from inside a chroot. what's the right way to do this? should i try to get the unix socket working, or can i force the client to connect over tcp?
00:40 <****> i don't want to change the bind-address
00:40 <****> over tcp should work
00:40 <****> if possible
00:41 <****> the client is a php app and it's trying to use the unix sock. i guess i'll have to dive in and figure out how to force it to do otherwise?
00:41 <****> hmm, its still not returning anything


Total 27 pages. You are browsing page 1/27.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo