Fwd: Re: Quick SQL design help
Date: Sun, 10 Feb 2002 16:06:55 -0800 To: [EMAIL PROTECTED] From: tj marlin [EMAIL PROTECTED] Subject: Re: Quick SQL design help the SET data type comes to mind. there is a limitation of 64 for the set size. ciao At 05:23 AM 2/10/02 +, you wrote: Hello MySQL users I was wondering if one of you could advise me on the best solution to a problem I'm having - I'm sure this has been done before but haven't found anything in the archives. Basically the problem I am having is how best to handle multiple values for a specific column, in this case the values in question are coming from an HTML SELECT MULTI box processed by PHP. The way I have been doing this so far is to have a delimited value stored in a varchar column, e.g. If my select box returns the values 2,4 and 7 I insert into my table the string '|2|4|7|'. Surely there must be a better way than this - but it escapes me. In this setup the only way to match a specifc value when searching is to use the query: SELECT dataid,title FROM table WHERE category LIKE '%|4|%' Which obviously has a huge performance penalty - and of course you can't JOIN against any of these values. The only other way I thought of was to use a separate table for the category entries: SELECT dataid,title,category FROM table LEFT JOIN table_categories ON table.dataid=table_categories.dataid But in the example above this would return 3 entries, which I don't want, and I can't select a particular dataid which satisfies more than category, e.g. has categories 4 and 7 (i.e. for the example above the LIKE statement would be: WHERE category LIKE '%|4|%' AND LIKE '%|7|%'). Any ideas? Please help! Cheers, james - 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 __ Tom Marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Beware of Programmers who carry screwdrivers. - Leonard Brandwein - 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 - 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
Fwd: Re: Quick SQL design help
Date: Sun, 10 Feb 2002 16:06:55 -0800 To: [EMAIL PROTECTED] From: tj marlin [EMAIL PROTECTED] Subject: Re: Quick SQL design help the SET data type comes to mind. there is a limitation of 64 for the set size. ciao At 05:23 AM 2/10/02 +, you wrote: Hello MySQL users I was wondering if one of you could advise me on the best solution to a problem I'm having - I'm sure this has been done before but haven't found anything in the archives. Basically the problem I am having is how best to handle multiple values for a specific column, in this case the values in question are coming from an HTML SELECT MULTI box processed by PHP. The way I have been doing this so far is to have a delimited value stored in a varchar column, e.g. If my select box returns the values 2,4 and 7 I insert into my table the string '|2|4|7|'. Surely there must be a better way than this - but it escapes me. In this setup the only way to match a specifc value when searching is to use the query: SELECT dataid,title FROM table WHERE category LIKE '%|4|%' Which obviously has a huge performance penalty - and of course you can't JOIN against any of these values. The only other way I thought of was to use a separate table for the category entries: SELECT dataid,title,category FROM table LEFT JOIN table_categories ON table.dataid=table_categories.dataid But in the example above this would return 3 entries, which I don't want, and I can't select a particular dataid which satisfies more than category, e.g. has categories 4 and 7 (i.e. for the example above the LIKE statement would be: WHERE category LIKE '%|4|%' AND LIKE '%|7|%'). Any ideas? Please help! Cheers, james - 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 __ Tom Marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Beware of Programmers who carry screwdrivers. - Leonard Brandwein - 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: Dates: To Slash or to Hyphen. That is the question
if you don't want the user to input trash, don't give him the opportunity. on your form, put three two character input fields. label the fields month, day and year, or what ever is the most common order that your user will input a date. put '-' or whatever, between the fields - just to make them look pretty. now you get three fields back. each of which must contain a one or two digit number (don't worry about the year 2100 problem; neither you, your computer or your sfw will be here). checking for numbers is real easy. in fact, i would do the checking on the client side in javascript. yeah, you have to do a little more work in tearing apart and putting together dates and times. but this is a simple function. hth - obligatory strings mysql, database, sql At 03:18 AM 8/16/01 -0700, you wrote: On Thu 16. August 2001 08:33, Van wrote: Greetings: Building a web form. There are 3 datetimes: RequestDate, FulfillDate, and CancelDate. New record populates a web form with the current date/time in -mm-dd hh:mm:ss format. RequestDate is current date, FullFillDate and CancelDate are -00-00 00:00:00. Updates present them with a record with the -mm-dd hh:mm:ss formatting directly selected from the mysql_query. If the end-user doesn't manipulate the dates, all goes fine. Just updates the record with the current values in the web form. If they want to change one of these dates, they might be inclined to put slashes in their dates rather than hyphens. They also might want to just put the day and the month (no time and no year). snip _ tom marlin tjmarlin@nospamsurfree.com My mind wanders a lot; sometimes it leaves completely. - Duncan Hill - 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: Float Issue
.1 can not be represented exactly on a binary machine. there must be an approximation stored in the fractional bits of the floating point representation. there are more fractional bits in a double than in a float. so the approximation is better. see the user manual for exact sizes. At 12:51 PM 8/14/01 -0400, you wrote: Hi, There seems to be a round-off problem with FLOAT. Here's a scenario to replicate it... -- $ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1149 to server version: 3.23.41 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql CREATE TABLE crap (blah float(10,2) DEFAULT '0.00' NOT NULL, blah2 double(10,2)); Query OK, 0 rows affected (0.00 sec) mysql insert into crap VALUES ('211710.10','211710.10'); Query OK, 1 row affected (0.00 sec) mysql select * from crap; +---+---+ | blah | blah2 | +---+---+ | 211710.09 | 211710.10 | +---+---+ 1 row in set (0.00 sec) mysql /q -- Everything works with DOUBLE fine as you can see. Just thought i'd bring it to someone's attention. FLOAT seems to work with smaller numbers but when the values start getting big, this sort of thing starts happening. Thanks Dave - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 My mind wanders a lot; sometimes it leaves completely. - Duncan Hill
Re: Parsing text file into mysql database.
with the sircam virus going around, i'm not into opening attachments. my guess is that you are running into the cr/lf problem. windows terminates lines with a cr/lf. unix uses only a lf. so when you read the windows file, the cr terminates a record and then the lf terminates the interspersed empty record. hth At 08:42 PM 7/30/01 -0500, you wrote: While parsing into a mysql database using php, I have successfully entered data into the database from an uploaded txt file. My problem surrounds the fact that in between every data filled record in the database, is an empty record. What causes this? my test code is attached. thanks, kit _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp - 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 _ tom marlin tjmarlin@nospamsurfree.com My mind wanders a lot; sometimes it leaves completely. - Duncan Hill - 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: Telnet
There are secure telnet packages. one for windows is SecureCRT. see www.vandyke.com for tips and pointers: basic telnet gives you a link to your server thru your own pc. it is as if you were directly connected to your server. At 01:24 PM 7/28/01 -0600, you wrote: On Saturday 28 July 2001 12:23 pm, B. van Ouwerkerk wrote: You should try to avoid using telnet to be honest, its not secure. Start using ssh and do a google for ssh usage. PHPmyAdmin is a great program to use for working with a mySQL DB. http://www.phpwizard.net/projects/phpMyAdmin/ But honestly stay away from Telnet. Kat At 18:06 28-7-01 +0200, Marco Bleeker wrote: I need to Telnet into my domain in order to run some MySQL utility like mysqldump (for backup). I am not experienced with Telnet. Any pointers? Any way around it (use mysqldump from PHP?) Good reason to learn it :-) You could try phpadmin (or was is myphpadmin.. anyway.. it is called something like that). | __@ | _`\,_ |__(*)/ (*)_Ah, op DIE fiets ! Ja. Bye, B. - 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 -- James McLaughlin ProjectBank.net Online Utility Project Reporting and Resource Center http://www.projectbank.net/ - 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 _ tom marlin tjmarlin@nospamsurfree.com My mind wanders a lot; sometimes it leaves completely. - Duncan Hill - 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: I need help constructing a search thingy using % _ in LIKE
yes, but then you wouldn't learn. if you don't want to buy Dubois' book, try appendix J of the mySql reference manual, available for free from the mysql site. At 06:06 PM 7/26/01 +0100, you wrote: In message [EMAIL PROTECTED], tj marlin [EMAIL PROTECTED] writes I think it is time for you to learn about regular expressions; page 520 ff of Dubois. (sql, mysql, database - to get past the filter) any chance of an example or full syntax? M. -- Work:- postmasterAThinwick.demon.co.uk WEB:- http://www.hinwick.demon.co.uk Work:- mworsdallATshaftesburysoc.org.uk REPLACE AT with @ Home:- hinwickATworsdall.demon.co.ukWEB:- http://www.wizdom.org.uk Shadow:- webmasterATshadow.org.uk WEB:- http://www.shadow.org.uk - 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 _ tom marlin tjmarlin@nospamsurfree.com My mind wanders a lot; sometimes it leaves completely. - 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: DISSERTATION2 [VIRUSES STRIPPED]
This virus is becoming wide spread. It appears to use a machine's address book and mail itself to the members of the address book. i've received mail with the virus from a number of people, in addition to receiving it from this list. At 05:04 PM 7/27/01 -0400, you wrote: On Fri, 27 Jul 2001, Steve Brazill wrote: It's nice to see that someone has an 'auto-response' setup for incoming infected messages... BUT, by the looks of the original Email (at the bottom of this message), it was an intentional attack on the list... - Original Message - From: Marty Bright [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 9:54 PM Subject: DISSERTATION2 [VIRUSES STRIPPED] Hi! How are you? I send you this file in order to have your advice See you later. Thanks Nope, SirCam virus, not deliberate. Symantec have a decent analysis and a free standalone tool to remove the virus. (Downloads, Virus Removal Tools). I've only had to tell a few people so far.. guess I'm not in may contact lists. Not that it matters, Pine doesn't care. P.s. Database :) -- Sapere aude My mind not only wanders, it sometimes leaves completely. - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 My mind wanders a lot; sometimes it leaves completely. - Duncan Hill
Re: REGEXP syntax
Mark: the key to this puzzle is the separator, the ';' for your first question, you need to find the ';' followed by a 6. not just any ';', but the first ';' the pattern would be ^[0-9]*;6 which says ^ find beginning of line [0-9]* followed by zero or more instances of any digit ; followed by a semi colon 6followed by a 6 with this you should be able to figure out the answer to your second question. At 09:55 PM 7/26/01 +0100, you wrote: Hi, Trying to get to grips with regexp but really want to 1st get a simple expression working with mysql. SELECT Sequence, Message, id FROM $sqlTable WHERE Sequence REGEXP(\^$filterValue;\) The above works for finding matched values, where the number = to $filterValue is in in the 1st part. But I need to do one for the 2nd part and 3rd and 4th etc, where each value is seperated by ; So I may want to search for 6 in the 2nd part, like below:- 1;6 10;6 100;6 1;6;1 10;6;10 100;6;100 I need a regexp that would get all of the above but not any value other than 6 in the 2nd part. Then say I was looking for 6 in the 3rd part:- 1;6;6 10;1;6 100;10;6 100;100;6 1;100;6 10;100;6 Any help would be appreciated. M. -- Work:- postmasterAThinwick.demon.co.uk WEB:- http://www.hinwick.demon.co.uk Work:- mworsdallATshaftesburysoc.org.uk REPLACE AT with @ Home:- hinwickATworsdall.demon.co.ukWEB:- http://www.wizdom.org.uk Shadow:- webmasterATshadow.org.uk WEB:- http://www.shadow.org.uk - 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 _ tom marlin tjmarlin@nospamsurfree.com My mind wanders a lot; sometimes it leaves completely. - Duncan Hill - 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: java.sql.SQLException: [TCX][MyODBC] Access denied for user... (Using password: No) message
the method signature for getConnection is: public static synchronized Connection getConnection(String url, String user, String password) throws SQLException try PURE JSP Java Server Pages by James Goodwill from Sams. a nice book. has some coding errors. At 04:02 PM 7/18/01 -0600, you wrote: I am starting using mysql and I made a java SimpleQuery servlet that is suppose to retreive one row from the database. However, when I try to connect I get that message from the Subject. I know I'm suppose to pass the password but can't seem to find a way of doing it. I was wondering if the problem was with those two lines or if it was in the tdx mysql driver default configuration in the ODBC. Class c = Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); dbConn = DriverManager.getConnection(jdbc:odbc:TestDSN;); I would appreciate if someone could help me to get my connection going. Thank you very much Luc Lalancette -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
Re: DELETING items
but before you issue this command and possibly trash your database, use select * from a_table where status='flag_value'; to look at the records which will be deleted. you may find some surprises. At 08:19 AM 7/16/01 -0400, you wrote: Why not: delete from a_table where status='flag_value'; Please read the manual, this is one of the most basic operations you can do, and is obvious the minute you look at http://www.mysql.com/doc -- Original Message -- From: rob anderson [EMAIL PROTECTED] Date: Mon, 16 Jul 2001 13:14:20 +0100 I am trying to delete records from a table, where the 'id' to be deleted should only happen if a certain flag (status) exists. The table contains one or more records for the same id, only the flag changes. I have tried create temporary table temp (id int not null); select id from tracking where tracking.status = 5; delete from tracking where id = select temp.id from temp; drop table temp; But this fails. I am not a SQL guru, and would appreciate any help Rob -- \\|// (@ @) ---oOO---(_)---OOo || | Mike Baranski | | Security Managment Consulting | | http://www.secmgmt.com | || || -- |__|__| || || ooO Ooo -- - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
Re: Book recommendation
MySQL, Paul DuBois, New Riders publishing, 2000, $40 At 10:25 PM 7/7/01 -0800, you wrote: The Mysql/Msql book I have from O'Reilly is definitely showing its age. I know there are books in the MySQL FAQ, butI am looking for recommendations. Any books that stand out as better than others? I'm also looking for a good PHP book that is a bit more advanced than the Beginning PHP book (from Wrox) I've just finished... c - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
Re: re-sorting auto_increment fields
i know it is large. the user must do his own calculations to determine if he can substitute eliminate for postpone. this is his call; not mine nor yours. At 09:57 AM 7/8/01 +0307, you wrote: tj marlin wrote: you can postpone this problem for a very long time by using an unsigned bigint (0 - 2**64-1) note i said postpone, not eliminate. Have you done calculations, how long it takes to reuse all id-s? I have done :). I bet that auto_increment field will be still young, fresh and alive even when this application is already dead after many years. -- For technical support contracts, goto https://order.mysql.com/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Tonu Samuel [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Security Administrator /_/ /_/\_, /___/\___\_\___/ Hong Kong, China ___/ www.mysql.com -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
RE: Multiple users.
they can't access them! are you sure about that? indeed, if a user is logged on to the web host, he is acting in the environment imposed by the operating system on the user session. in this case, the other databases - given that the correct permissions are established - can not be accessed. but consider the case where the database is accessed thru a web page. Dubois briefly discusses this topic in MySQL. Now the user - any user - is running as whatever the web page server is running as. so if user A wants to provide web access to his database, the login name and password must be available to the user that the web page server runs as. so i can write a script, invoke it thru the web server and read user A's cnf file which gives me his login name and password. I just got access. I'm trying to figure out a solution to this problem. If anyone has a solution, i would really appreciate the answer. I have a solution to prevent modifying the database, but it is really ugly - full of security holes. i do not have a solution to prevent reading the database. my web host is running linux with an apache web server. thanks At 04:54 AM 7/7/01 -0600, you wrote: Why does it matter? They can't access them, so what harm is there? I am sure that it has been asked before. I am running a hosting company and I am running mysql on a win2k server. We don't want any customer to see other db's of any other customer, we just want them to see their own db's only. But even if you connect with a username who has access to only one db, when you type show databases you can see all other databases easily. Is there any solution to this problem? Omer Barlas [EMAIL PROTECTED] www.emedia.gen.tr - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
Re: F IRST TIME USER
actually you are already using mysql. what you need to do is specify a database to use. to see the available databases, type show databases; then type use db name note, no ; if none of the existing databases are appropriate you must create a database. but this is another chapter. hth At 02:38 PM 7/7/01 +, you wrote: Hi everybody I am still having problem.. please help I am able to connect to my remote mysql server but fail to create, user any database ... I let you know step by step.. what I have done 1. First I have connected to my remote server through Telnet. After becoming root... I had supplied following command... 2. mysql -h mydomainname -u root -p it prompts for password : it is blank so I just pressed enter. and Mysql prompt appeared.. mysql Then I typed 3. mysql use mysql; Result : - ERROR 1045 Access deneid for user [EMAIL PROTECTED] using password : no Can you please help me in this regards? Thanks Anoop Buy Feng Shui Package for Rs. 151/- only, at http://shopping.rediff.com/shopping/fengshui_mailer.htm - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
Re: Localization with MySQL
my only comment on this is that although you appear to have two different problems - you don't! pick a single solution to both cases; then when your solution needs modification, you only have one set of code to change. this obviously is computer science; only tenuously related to mysql. At 02:55 PM 7/7/01 -0600, you wrote: I'm working on two projects for which I'm trying to build in functionality to localize or internationalize later. For one project, a large chunk of text would be translated into an unknown number of languages. For this I'm allowing the text to be a 'text' field in a record, with other fields holding the language code (i.e. 'en', 'fr') and another the charset for that language. For the second, only a set of keywords would be translated into a small number of languages. For this project I'm using one record per keyword, with the various language translations being separate fields within the record - the record 'id' is what drives searches in this case. I'm using an Apache server with Perl and PHP, and MySQL as a db (of course). The only steps I'm taking is to have a field specifying the language (in the first case) and to name the columns/fields by the language code (i.e. 'en', 'de, 'jp') in the second. I'm also allowing twice as many characters for the 'jp' field, since that language requires (as I understand it) 'double' characters to drive it. I intend to drive the content by (1) selecting the language according to the 'Accept-Language' variable in the user's browser OR (2) allowing the user to select a language manually. Obviously I'm not up to speed on the exact requirements of localization and using other languages, and am concerned more about some pedestrian basics first - I'm just trying to avoid painting myself into a corner. Is there anything else I should be doing, or doing different? Can you point me to any resources on localization that would help me build this right the first time? Thank you for any assistance, Nelson -- - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
Re: re-sorting auto_increment fields
there is a way: delete the column add the column then the auto increment will start from 1 up to the number of records. be careful! if there are records in other tables which refer the records in this table - the one being modified - those records WILL NOT BE UPDATED. and now your database is really broken. you can postpone this problem for a very long time by using an unsigned bigint (0 - 2**64-1) note i said postpone, not eliminate. hth At 11:31 PM 7/7/01 +0100, you wrote: Hi ANy idea how i can get my auto_increment fields to renumber themselves after deletion of records so that they all get re-ordered and run consecutively from 1 to whatever without any numbers missing ? Please help if you know how to do this Thanks Keith White -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
Re: Searching records ?'s
indexing the entire large text column really drags performance down, and consumes big hunks of disk space. mysql has a good regexp facility. rtfm At 10:52 PM 7/6/01 -0700, you wrote: Hi Everyone, I'm writing a script using perl for a search function. I have a large text column that I want to scan for certain words. I do something like the following: select * from table_name where column_1 LIKE %word1% AND column_1 LIKE %word2%; In this situation, words like 'tree' will return 'streets'. How can I find exact matches while still scanning the entire record? Are there any MySQL REGEX's that might help out. I'm considering indexing the entire column and compare my query against it but wanted to see if there were any other solutions out there. Thanks! Eric - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.
Re: Good book for MySQL and Perl DBI?
Mysql by Paul Dubois, New Riders publisher, is strongly recommended. Get the perldoc on dbi and dbd. terse, but up to date. other reading are: cgi programming 101 by jacqueline hamilton. basic information. well presented. with examples that work. very broad, very shallow. of course the camel book, Programming perl, larry wall, tom christiansen and jon orwant, o'reilly, 3rd ed. with these books and the internet, you will find a wealth of information. ciao At 04:40 PM 6/23/01 -0500, you wrote: Does anyone have any recommendations for a good book on MySQL SQL? What about PerlDBI (I noticed that the O'Reilly one is over a year old)? Just realizing that there's so much out there that I haven't been told... -Chris - 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 -- tom marlin [EMAIL PROTECTED] fax / voice mail: 714 507 3802 ext 4881 Never be afraid to try something new. Remember that - amateurs built the ark. - professionals built the Titanic.