#mysql
30 September 2007
Total 19 pages. You are browsing page 2/19.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
01:07 <****> how can I select max(id) into v_max_id from some table, and put a default number when the query returns null?
01:07 <****> XSMerlin where from_unixtime(somecol) between '2007-01-01' and '2007-09-29';
01:07 <****> seekwill: you weren't with me. So there was no way.
01:07 <****> thumbs: Do some lappys require you to operate in a certain state?
01:07 <****> let me check, i think there was an issue with that between
01:08 <****> yer, i think that mysql cant organise a timestamp comlum chronologically
01:08 <****> not sure tho
01:08 <****> Trengo: A timestamp column is in YYYY-MM-DD HH:MM:SS format
01:08 <****> seekwill: besides, I worked until 10 PM every day.
01:08 <****> XSMerlin: How about try my query?
01:08 <****> thumbs: Excuses!
01:08 <****> trying it now
01:09 <****> seekwill: I needed seekwill to get my way.
01:09 <****> thumbs: How come you're not playing now?
01:09 <****> I will in a bit.
01:09 <****> yeah, im getting an "impossible WHERE" error
01:09 <****> I landed an hour ago or so
01:09 <****> XSMerlin: Exact query and error message
01:10 <****> SELECT *
01:10 <****> FROM `tbl_orders`
01:10 <****> where 'order_timestamp' BETWEEN '2007-09-01' AND '2007-10-01'
01:10 <****> `order_timestamp`
01:10 <****> quotes
01:10 <****> Use ` around identifiers (database/table/column/alias names) and ' around strings and dates. MySQL does allow " for strings, but ANSI standard uses " for identifiers (which you can enable with ANSI QUOTES option) and dont quote numbers
01:10 <****> And timestamps comes with TIME.
01:10 <****> (while MySQL may work without it, you should put one in)
01:10 <****> pairs
01:11 <****> cant remember why :z
01:11 <****>
01:11 <****>
01:11 <****> seekwill a unix timestamp is an integer counting seconds
01:11 <****> Trengo: A MySQL timestamp column is not a unix_timestamp
01:12 <****> hmm
01:13 <****> oh right
01:13 <****> [Live FFF] ERROR 1054: Unknown column '2007-09-01 00:00:00' in 'where clause'
01:13 <****> i wasnt thinking of mysql timestamp
01:13 <****> XSMerlin: pastebin your entire query
01:13 <****> kk
01:13 <****> XSMerlin: NOT in the channel.
01:13 <****> pastebin
01:13 <****> try http://pastebin.ca or http://pastebin.mysql-es.org
01:13 <****> soz
01:14 <****> http://pastebin.ca/720076
01:15 <****> quote
01:15 <****> Use ` around identifiers (database/table/column/alias names) and ' around strings and dates.
01:16 <****> XSMerlin: don't use ` to delimit values.
01:16 <****> use ' instead.
01:16 <****> gotcha
01:16 <****> thats the ticket, thank you muchly
01:16 <****> i know it's possible to dump only a portion of a total database, however, how do you import that portion back into the database without dropping the whole db?
01:20 <****>?
01:29 <****> Voté Charles-Alexandre Deschamps (Pour qu'il peut aller en tournoi de skate-board) Vote pour Charche-Alexandre : http://islandproductions.org/blog/?page_id=355Q
01:47 <****> JavaGeek: http://www.databasejournal.com/features/mysql/article.php/10897_3525581
01:47 <****> then http://www.databasejournal.com/features/mysql/article.php/3547931
01:49 <****> if that all makes sense follow up with http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html
01:49 <****> look for the pdf
01:52 <****> Is there any reason why adding a TEXT column to an optimized table is a bad idea performance-wise? Design-wise it makes sense -- the TEXT is directly related to the items.
01:53 <****> as long as you don't add TEXT in the primary key, or in an index, I can't see why it would be a bad idea
01:53 <****> Hey, i realize you don't want to help everyone who walks in... but can someone help be figure out how to set my databases to be utf8
01:53 <****> why not make it a foreign key to a new table so that you dont end up over indexing?
01:53 <****> Terinjokes: you need to modify the collation
01:54 <****> mikegriffin: That was the kind of advice I was afraid of getting. It sounds... wrong.
01:54 <****> im not a dba
01:54 <****> Still, the TEXT is logically directly related to the item.
01:54 <****> Cahaan: i attempted that, but it complains about latin1
01:54 <****> It "feels" like having a huge TEXT for each row would make it slower.
01:55 <****> But this is most likely false.
01:55 <****> As indexes are... indexed!
01:55 <****> i assume you have read about 3nf normalization?
01:56 <****> Cahaan: i would like it to be utf8_unicode_ci
01:56 <****> well Terinjokes, I don't know why it complains :) do you get some specific error code ?
01:57 <****> Cahaan: well... IDK... let me try it again
01:57 <****> Cahaan: cant you convert to binary and then back to avoid bad conversion or something?
01:57 <****> mikefoo: Never heard of.
01:57 <****> I just know about normalization period.
01:57 <****> http://en.wikipedia.org/wiki/Database_normalization
01:57 <****> I don't see how it can have different levels.
01:58 <****> Either it's normalized or it's not.
01:59 <****> mikegriffin: well, I'm not sure. I used utf8_unicode_ci at the beginning for all my projects :)
01:59 <****> Cahaan: much safer
02:00 <****> Cahaan: setting it for just one database seems to work... but I would like to set it globally, and that where it complains
02:01 <****> Cahaan: using this page: http://dev.mysql.com/doc/refman/5.0/en/charset-server.html
02:02 <****> on the webpage, "Michaël" becomes "Micha?l"
02:03 <****> Terinjokes: that is what i was saying might happen
02:04 <****> try converting to binary and back
02:04 <****> http://forums.mysql.com/read.php?103,107142,108718
02:04 <****> mikegriffin: i'm sorry, wasn't reading your posts :P
02:05 <****> actually go back to latin then bin then utf
02:06 <****> mikegriffin: i inserted the data when it was set UTF8
02:06 <****> is apache set to latin?
02:07 <****> after MySQL got messed up, I rebuilt the mysql database (emerge --config mysql) and put all the databases back
02:07 <****> or php rather
02:07 <****>"
02:07 <****> but now, whenever I try to select anything from any table in a database (that was there before), I get 0 results (even though there are rows that should be returned)
02:07 <****> grep default_charset /etc/php.ini
02:08 <****> i dunno
02:08 <****> how do I make mysql aware that there is a table/database? (eve though it can access the database and show the tables and everything, except select queries don't work)
02:08 <****> i havent really dealt with this issue much
02:08 <****> slavi1: grants
02:08 * Terinjokes has to find his php.ini
Total 19 pages. You are browsing page 2/19.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
