update and data manipulation
Hello When I want to update a value, I can use numerical functions like +,* etc. Can I do the same with strings? For example, when I want to append a string in an existing value, how (if of course) can I do it inside the update query? Thanks. Nikolas p.s: I know I can do it with PHP, I was just wondering if it is possible with SQL. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
character set when you don't manage the server
Hi I have written a web application that is hosted in a server which uses the default character set. This causes problems in the sorting that MySQL does because most of the data is in Greek. When developing it locally, I run the MySQL server with the greek character set and sorting works fine. How can I handle this on the server where (obviously) they don't use the greek character set? Is there a way to force the use of a specific character set when you dn't manage the MySQL server? Thanks. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
mysql server with different character sets per user
Hello I was wondering about the following: I am hosting an application with a web hosting company and the character set doesn't satisfy me because I am doing some sorting of greek names and the hosting company uses the default character set for the mysql server. Is it possible that they let my account use a different character set than the default? I am going to ask them but I would like to know whether it is possible. Thanks. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: timestamp updated on select
Hello I have a column of type timestamp(14) and I thought it would not be updated on a query with simple select statements, though it does! I read in the manual that it shouldn't, what could be wrong? Thanks. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: timestamp updated on select
Ok, here we are, in much detail. There is a table called translations and another one called poems. Their structure is given in the end. The query (given by a php script by the way) is: select poems.poem_id, language, translation_title,made_by_id from poems,translations where poems.poem_id=translations.poem_id order by date_added desc limit 0,10 and with this I intend to retrieve the 10 latest additions of translations. However, when running the script, I noticed that always, on the top of the results was the translation link I had clicked last. And this happens all the time. Now that I think of it again, the clicked link contains a mysql query which increments the translation views by one. H.maybe this does the unwanted update CREATE TABLE `poems` ( `poem_id` smallint(4) unsigned NOT NULL auto_increment, `poem_title` varchar(38) default NULL, `poet_id` smallint(4) unsigned default NULL, `comments` varchar(255) default NULL, `poem_views` smallint(5) unsigned NOT NULL default '0', `poem` text, `poem_comment` text NOT NULL, PRIMARY KEY (`poem_id`) ) TYPE=MyISAM and CREATE TABLE `translations` ( `poem_id` smallint(4) unsigned NOT NULL default '0', `language` varchar(14) NOT NULL default 'english', `translation_title` varchar(54) default NULL, `translation_text` text, `footnotes` text, `made_by_id` smallint(4) unsigned NOT NULL default '0', `contributed` varchar(70) default NULL, `translation_views` smallint(5) unsigned NOT NULL default '0', `date_added` timestamp(14) NOT NULL, PRIMARY KEY (`poem_id`,`language`,`made_by_id`), KEY `language` (`language`) ) TYPE=MyISAM Paul DuBois wrote: At 2:09 +0200 11/7/02, Galanis Nikolas wrote: Yes, that is exactly what happens. It is updated with a simple select statement. It is a select from a table which contains only one timestamp column and the order by is made by this timstamp column. And every time the value if the timestamp is updated. That seems fairly strange. Let's see an example. On Wed, 6 Nov 2002, Paul DuBois wrote: At 23:47 + 11/6/02, Nikolas Galanis wrote: >Hello > >I have a column of type timestamp(14) and I thought it would not be >updated on a query with simple select statements, though it does! I >read in the manual that it >shouldn't, what could be wrong? Thanks. You're saying that performing a SELECT on the table causes the > TIMESTAMP column to *change*? That shouldn't happen. -- - - Nikolas Galanis - - Computer Engineering & Informatics Department - - University of Patras - - http://www.ceid.upatras.gr- - 061 997707- - - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Returning an Auto-Increment Field
I think that the mysql function LAST_INSERT_ID() is what you need. Tim Johnson wrote: Hello All: If I am adding a row to a table that has an auto-increment field, is there a way to query MySQL for the value of that field, once the new row is added? TIA -- - - Nikolas Galanis - - Computer Engineering & Informatics Department - - University of Patras - - http://www.ceid.upatras.gr- - 061 997707- - - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php