#mysql
31 October 2007
Total 29 pages. You are browsing page 3/29.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
01:39 <****> can't you remove it in the gui tool?
01:40 <****> remove what? the host i added?
01:40 <****> this is weird
01:40 <****> devicenull: that's the anonymous user
01:41 <****> when I try mysqlimport I get database mysqlimport --local databank ./databank.txt | more mysqlimport: Error: Table 'databank.databank' doesn't exist, when using table: databank
01:41 <****> wtf?
01:42 <****> uh
01:42 <****> is there any reason why mysql would ignore --port on the command line?
01:42 <****> JohnnyL: read the doc, the filename will be the tablename, you only specify the database name
01:42 <****> oh ok.
01:42 <****> I'm doing mysql -u my_user --port=3333 and it's still connecting to the install on 3306
01:43 <****> kimseong, i tried that too.
01:43 <****> devicenull: -hlocalhost will use socket
01:43 <****> ahh
01:43 <****> thanks
01:43 <****> JohnnyL: did you have the table?
01:43 <****> kimseong, no just the database name.
01:43 <****> mysqlimport is to import csv data into an existing table
01:43 <****> kimseong,oh.
01:43 <****> kimseong,do i just use mysql < data.txt ?
01:44 <****> kimseong, works, thanks.
02:08 <****> WHERE IS ARCHIVIST?
02:08 <****> I think snoyes knows.
02:08 <****> snoyes has emailed with him i think
02:11 <****> i was about to write a script for something a simple query could probably do.. remove all categories, for which there is no product associated with.. products and categories are associated with each other by a products_to_categories table
02:11 <****> products and categories have an auto increment field as pk
02:13 <****> something like.. DELETE FROM categories WHERE categories_id NOT IN (SELECT categories_id FROM products_to_categories) .. hmm, no thats not right
02:15 <****> can you get a join to return just the entries which dont match? ie.. all null entries?
02:16 <****> snadge: yes
02:23 <****> anyone here ever got a venture capital loan before?
02:24 <****> chadmaynard: whats the simplest way to do this? :P empart some wisdom
02:25 <****> my original plan was to just write a php script which first queries all categories.. then checks to see if there is a product associated with that category, and deletes it if not.. which seems like a long way to do it
02:26 <****> snadge: outer join
02:28 <****> I found no mysqltest_embedded in mysql-noinstall-4.1.22-win32.zip
02:29 <****> And I can't build it from source, any help would be appreciated
02:30 <****> ok so i got the first bit right.. DELETE FROM categories WHERE categories_id IN (SELECT * FROM categories a, products_to_categories b WHERE a.categories_id = b.categories_id AND b.categories_id IS NULL) ?
02:30 <****> sigh
02:30 <****> thats not right either
02:30 <****> snadge: DELETE FROM a LEFT JOIN b ON a.id = b.aid USING a WHERE b.aid IS NULL
02:31 <****> hmm.. i've never used a using before :P
02:33 <****> snadge: you have to tell it which table to use
02:34 <****> snadge: DELETE a.* FROM ... does the same
02:34 <****> i see.. im doing a select first just to make sure its returning the right rows ;)
02:34 <****> not that i dont trust you hehe
02:35 <****> well just be sure to tell me every move you make
02:36 <****> hi folks, i'm upgrading an app that had been using the mm.mysql driver to now use Connector/J. One thing out of the box is that ConnectorJ does not let you use statement.executeQuery() for anything that modifies data (UPDATE, INSERT, etc). is this something new with Connector/J and I wa sjust doing it wrong before? (I have a ton of executeQuery(sql) commands wher ethe sql is an insert or an update)
02:37 <****> Where can I get a prebuild mysqltest_embedd.exe for 4.1.22,
02:37 <****> or provide instructions to build it from source on windows,
02:37 <****> there is only a project for mysqltest, no mysqltest_embedded found.
02:41 <****> thanks chad.. i've returned the rows i want to delete with the select.. now i just have to change the select to a delete and add the using clause
02:42 <****> hi
02:42 <****> so it only deletes the categories and not any rows in any other table ;)
02:43 <****> i need help with a VERY important thing , i can't really find a website or else with all the anti sql injection ... anyone can help me ?
02:43 <****> hackmanT: its not too difficult, just dont trust any input from the user, make sure you escape quotes before using it in SQL
02:44 <****> yea yea , i can't find a website with command to escape them and all ...
02:44 <****> are you using PHP?
02:44 <****> yea
02:44 <****> look up 'magic quotes' or addslashes()
02:44 <****> depends on the language.. in php i use mysql_real_escape_string
02:44 <****> or that.
02:45 <****> magic is fucked .... it seems not really secured
02:45 * hackmanT have said 65 times : 'f*ck'
02:45 <****> srry
02:45 <****> -_-
02:45 <****> thats why my php code tends to strip slashes from input, then add them again
02:45 <****> you can test if magic quotes is enabled, but whatever ;)
02:46 <****> yea i will keep the 2 other ideas given elkse than magic quotes .. addslashes() =php || mysql_real_escape_string=mysql thx all :P
02:47 <****> orly.
02:47 <****> cause explaination on websites aren't so clear ...
02:49 <****> well that was short but know i'm off ;) thanks again
02:49 <****> kno*
02:49 <****> now*
02:49 <****> ihate my keyboard
02:49 <****> bye
02:56 <****> hmm.. so you cant delete from two tables at the same time?
02:56 <****> eg.. i want to delete the categories description as well
02:56 <****> DELETE FROM categories, categories_description cd LEFT JOIN .. barfs on the LEFT JOIN
02:57 <****> So I am trying to design a sql query that can "divide" two tables; ex: One table contains supplier ids {'S1', 'S2', 'S3'} the divisor a part number {'P1'} and the mediator -contains reference which suppliers supply which part- {'S1', 'P1'; 'S2', 'P3'; 'S3', 'P1'}.
02:57 <****> The result should be S1, S3 since they contain P1; any ideas on the syntax for something like that?
02:57 <****> snadge: i gave you the syntax
02:58 <****> true.. i butchered that a bit since i wanted to delete description as well
02:58 <****> what is description?
02:58 <****> a table?
02:58 <****> yes.. its stored in a seperate table since the language can affect it
02:59 <****> categories_description
02:59 <****> DELETE t1.*, t2.* FROM .........
02:59 <****> snadge: check the manual for syntax
02:59 <****> or USING (t1, t2)
02:59 <****> specify tables 2 times, 1 for which to delete, 1 for the join
02:59 <****> no * in delete
03:00 <****> kimseong: it works
03:00 <****> with the * ?
03:00 <****> yea
03:01 <****> i remember delete * from table will not work
03:01 <****> no that won't work
03:02 <****> delete t1.* , would this be intepreted as database t1, table * ?
03:02 <****> no
03:02 <****> i guess not, but the . is to qualify the table name with database name
03:03 <****> kimseong: http://rafb.net/p/YwDQBU65.html
03:05 <****> thanks again.. worked a charm :)
Total 29 pages. You are browsing page 3/29.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
