Migrating form 3.23.49 to 5.0.32
I'm doing the above migration as mentioned in the subject line. I figured I would use the MySQL Migration Toolkit to help it along but it won't let me connect to my 3.23.49 server. Is there any other way to migrate all my data easily. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Help with Query
I need to get some duplicate record information from a table and I haven't found any way to do it yet. I figured there might be some type of query I could do using a for each type command. What I have is a table with names and companies. Some people have multiple entries for different companies. What I need to get is the name that has multiple entries along with the company names. Name| Company Joe BlowCompany 1 Joe BlowCompany 2 Joe G. Blow Company 1 Running the query should only return Joe Blow with Company 1 and Company 2. I can find out how many records Joe Blow has or list out each Company record grouped by Name but I only want Names with multiple entries shown. Can anyone help? I'm sure this also makes a difference but I'm stuck using MySQL 3.23. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
date_add function
I'm having some trouble setting a future date within a table. I have one column 'this_date' which is a DATE field and I'm trying to add 90 days to it and set a column named 'future_date', also a DATE field. I don't know if the problem is that I'm trying to write the value into the 'this_date' and 'future_date' fields in the same query. UPDATE this_table SET this_date = $this_date, future_date = (DATE_ADD(this_date) INTERVAL 90 DAY) Would this work? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: date_add function
On Wed, 11 Oct 2006, Mark Leith wrote: Ed Curtis wrote: I'm having some trouble setting a future date within a table. I have one column 'this_date' which is a DATE field and I'm trying to add 90 days to it and set a column named 'future_date', also a DATE field. I don't know if the problem is that I'm trying to write the value into the 'this_date' and 'future_date' fields in the same query. UPDATE this_table SET this_date = $this_date, future_date = (DATE_ADD(this_date) INTERVAL 90 DAY) Would this work? Thanks, Ed UPDATE this_table SET this_date = NOW(), future_date = NOW() + INTERVAL 90 DAY; This is probably along the lines of what you want.. Actually I'm setting the DATE via drop down menus using PHP and creating the date by hand via variables. NOW() won't work in this instance. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: date_add function
On Wed, 11 Oct 2006, Rolando Edwards wrote: Please check your syntax. It should look like this: UPDATE this_table SET this_date = $this_date, future_date = DATE_ADD($this_date,INTERVAL 90 DAY); Don't forget your WHERE clause or else you populate every row. Tried it, this is what I get back. You have an error in your SQL syntax near 'future_date = date_add(2008-10-20, INTERVAL 90 DAY) WHERE id =' -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: date_add function
On Wed, 11 Oct 2006, Rolando Edwards wrote: Oops, also the $this_date UPDATE this_table SET this_date = '$this_date', future_date = DATE_ADD('$this_date',INTERVAL 90 DAY); Got it going guys, thanks again Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Help with query
I'm trying to do a keyword search within a phrase saved in a table. Here's the query: SELECT * from closedtickets WHERE keyphrase LIKE '%$keyword1%' OR keyphrase LIKE '%$keyword2%' OR keyphrase LIKE '%$keyword3%' The problem I'm having is that the query is returning every record in the table. I only want it to return the records where the keywords (any combination) are contained within 'keyphrase' Any ideas? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Replacing A Value
I have a column in a table I need to replace a value of certain records in. The current value is /realtors/Value/. I need to change them to /realtors/This_Value/. Is there an easy way to do this. There are way too many records to do it one record at a time. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
REITF?
Does anyone on the list know what REITF stands for? I'm guessing it's some type of data format for real estate information but I can't find any information on it anywhere. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: problem with mysql.sock
I could be wrong but this may have something to do with ownership and permissions of the socket file. I recently upgraded my MySQL version and had basically the same problem. I can't remember though if I had to change the ownership to root.root or mysql.mysql. HTH, Ed On Mon, 26 Sep 2005, Sandhya Reddy wrote: Hello, I have recently installed FC3 and now I have PHP(4.4.9) and MYSQL(3.23) which got installed along with FC3. I'm able to connect to MYSQL from command prompt. But the problem fires when I do the same from a PHP script. The error I get is Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13). And I'm sure that MYSQL server is running and able tp connect from command prompt. I have been searching on the net for the same from the last 3 days but ended with nothing. I have changed php.ini to include the mysql_default_socket=/var/lib/mysql/mysql.sock. even then it doen't work. Earlier I had FC1 and everthing was working fine! Could please suggest me a solution to tackle this problem. Thanks in Advance Sandhya __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Finding row by value of a certain length
I've been cruising the docs for a while now and can't find what I'm looking for. I know it has soemthing to do with value or LEN or something easy like that but I just can't find the right command structure. I need to list the rows in a table where the length of a field, lets say field1 is a minimum of 60 characters or larger. The field type is varchar. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Finding row by value of a certain length
On Wed, 22 Jun 2005 [EMAIL PROTECTED] wrote: You were SO close!!! SELECT field list FROM table references WHERE CHAR_LENGTH(varcharfield) = 60; Thanks so much. I knew I was close but couldn't remember the exact command. Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
SELECT ERROR
I'm trying to compare 2 tables and keep getting an error. SELECT * from listings where listings.id = fake.id; The error is Error 1109: Unknown table 'fake' in where clause or Error 1109: Unknown table 'listings' in where clause depending on the table order at the end of the query. Both tables do exist and I can select any or all contents from either of them seperately just not using the command above that practically comes straight from the documentation. Any ideas? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: SELECT ERROR
Thanks, as soon as I seen it I slapped myself really hard :) On Wed, 23 Feb 2005, mel list_php wrote: If you want to compare the 2 tables you have to join them: select * from listings, fake where listings.id=fake.id; If you do your query SELECT * from listings where listings.id = fake.id; it simply doesn't know where to get fake.id From: Ed Curtis [EMAIL PROTECTED] To: mysql@lists.mysql.com Subject: SELECT ERROR Date: Wed, 23 Feb 2005 08:02:21 -0500 (EST) I'm trying to compare 2 tables and keep getting an error. SELECT * from listings where listings.id = fake.id; The error is Error 1109: Unknown table 'fake' in where clause or Error 1109: Unknown table 'listings' in where clause depending on the table order at the end of the query. Both tables do exist and I can select any or all contents from either of them seperately just not using the command above that practically comes straight from the documentation. Any ideas? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] _ Want to block unwanted pop-ups? Download the free MSN Toolbar now! http://toolbar.msn.co.uk/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
SELECT UPDATE question
I know this is possible but I'm not real sure of the command to use. I have 2 tables that are pretty much identical except for one column. What I want to do is moved data from one table column to the other table column based on a matching id number that is also a column in both tables called id. UPDATE table2 SET active = '1' WHERE table2.id = table1.id; is this the correct syntax? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
NOT LIKE
I've been searching the docs and can't find examples how to do what I need to do. I need to exclude some records from my SELECT statement results but it appears I can't use (=, != or LIKE) for it. What I have is a result set having a column name 'path'. I need to exclude any record reulting in '/realtors/Kokomo/%' You can't use wildcards when using = or != as far as I can see. How do I exclude any records where the path column is '/realtors/Kokomo/%'? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
slashes in update statement
I'm trying to get a slash in a variable into my database and am having some trouble. If the variable = 1 1/2 it echoes to the screen correctly but it seems to strip the 1/2 off the variable when updating the value to the database. I'm using php and a form select list to get this value from a previous page. Any ideas? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Selecting data from 2 tables.
God, I feel real stupid this morning and know I should know this. I have 2 tables in the same database and I'm trying to select distinct data from a row with the same name in each table. SELECT DISTINCT company FROM pages, pdflog ORDER BY company ASC I'm missing something I'm sure because it doesn't work. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Selecting data from 2 tables.
Feel stupid again ;-) Where's your JOIN? With regards, Martijn Tonies Thanks, that makes me feel better :) Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Selecting data from 2 tables.
On Mon, 9 Aug 2004 [EMAIL PROTECTED] wrote: He does have a join. He has an *implied* INNER JOIN (http://dev.mysql.com/doc/mysql/en/JOIN.html): FROM pages, pdflog What he is really missing is the WHERE clause that matches something from pages with something from pdflogWithout it he is requesting a Cartesian product of his tables (every combination of each row from both tables). I prefer to define my JOINS *explicitly*. It makes it harder to accidentally define Cartesian products): SELECT DISTINCT company FROM pages INNER JOIN pdflog ON ...some condition goes here ORDER BY company Shawn Green Like I said I knew I was missing something. I just couldn't for the life of me remember what it was. All I needed was a nudge. Thanks all, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Selecting data from 2 tables.
What he is really missing is the WHERE clause that matches something from pages with something from pdflogWithout it he is requesting a Cartesian product of his tables (every combination of each row from both tables). I prefer to define my JOINS *explicitly*. It makes it harder to accidentally define Cartesian products): SELECT DISTINCT company FROM pages INNER JOIN pdflog ON ...some condition goes here ORDER BY company Shawn Green Database Administrator Unimin Corporation - Spruce Pine OK now I really really feel stupid. Now that I've been given the correct way this particular person wants this done. What I need to produce is a distinct list from pages.magazine and pdflog.magazine without a condition. Just a list of all data in these table columns without duplicates. Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Selecting data from 2 tables.
I think a quick way to write this query would be (http://dev.mysql.com/doc/mysql/en/UNION.html): ( SELECT magazine FROM pages ) UNION DISTINCT ( SELECT magazine FROM pdflog ) ORDER BY magazine; Thanks for all the help on this one. I just also realized that the server I'm working with has version 3.23.x of MySQL. My only other option now is to create a temp table with distinct data from both tables, is it not? Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Copying a database
How would you go about copying a database? I need to make a copy with all the tables and names the same. I just need to name the database something different. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Security
I guess the easiest way to do this would be to index all transactions with a user id number or something identifying the user. When they log in to the site have the scripts only access the records for that person using a WHERE clause in the queries. You would have to be able to keep track of their user id for them via cookies or sessions or something though. Ed Curtis On Tue, 9 Mar 2004, Mulugeta Maru wrote: Thank you for the kind response. May be I did not clearly ask the question. The user table in mysql database is used to set-up a user and password. Once I set-up my tables (customer, customer orders, customer order details, etc) in say abc database what will I have to do to make sure when customer A logs in to the database can only see his/her account, orders, order details without getting access to other customer accounts. I hope my question is clear. Maru - Original Message - From: Paul Rigor [EMAIL PROTECTED] To: Mulugeta Maru [EMAIL PROTECTED]; MySQL [EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 7:46 PM Subject: Re: Security Heya, Those are the default databases that comes with the setup. the mysql database holds info on mysql accounts. the test is an empty database. You should create a new database CREATE DATABASE customers then use customers... after that... you can setup the tables you mentioned. Goodluck! Paul At 06:34 PM 3/9/2004, Mulugeta Maru wrote: I have used access in the past and now I have started using MySQL. I have customer table, customer order table, customer order detail table. How would I make sure that when a particular customer log-in he/she sees only the account that is set-up for them. What confused me is that MySQL has a database called mysql and a table in this database called users that is used to set a user name and password for each user. I could not figure out how a user in my case a customer that has access to a customer table could be restricted to see his/her transaction only. Any insight is very much appreciated. _ Paul Rigor [EMAIL PROTECTED] Go Bruins! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Query matching
I've been challenged to write a matching query in a project and do not know how to handle a part of it. The criteria are as follows: SELECT * from pages WHERE changelog.agent = pages.agent AND changelog.company = pages.company AND changelog.magazine = pages.magazine Now for the challenging part for me at least. one of the following must at least be true for the query to return a result. changelog.orig_id = pages.mls_1 changelog.orig_id = pages.mls_2 changelog.orig_id = pages.mls_3 changelog.orig_id = pages.mls_4 changelog.orig_id = pages.mls_5 changelog.orig_id = pages.mls_6 changelog.orig_id = pages.mls_7 changelog.orig_id = pages.mls_8 changelog.orig_id = pages.mls_9 changelog.orig_id = pages.mls_10 changelog.orig_id = pages.mls_11 changelog.orig_id = pages.mls_12 Would I nest these as an OR statement and how would I go about it? Thanks, Ed Curtis -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Query matching
Thanks, that seemed the sensible way to me as well. I just didn't know for sure if you could do that in a MySQL query for sure. Thanks, Ed On Fri, 6 Feb 2004, John McCaskey wrote: Yes, I think the most straight forward way is to simply put in a series of grouped OR statements. See below. SELECT * from pages WHERE changelog.agent = pages.agent AND changelog.company = pages.company AND changelog.magazine = pages.magazine AND ( changelog.orig_id = pages.mls_1 OR changelog.orig_id = pages.mls_2 OR changelog.orig_id = pages.mls_3 OR changelog.orig_id = pages.mls_4 OR changelog.orig_id = pages.mls_5 OR changelog.orig_id = pages.mls_6 OR changelog.orig_id = pages.mls_7 OR changelog.orig_id = pages.mls_8 OR changelog.orig_id = pages.mls_9 OR changelog.orig_id = pages.mls_10 OR changelog.orig_id = pages.mls_11 OR changelog.orig_id = pages.mls_12 ) John A. McCaskey -Original Message- From: Ed Curtis [mailto:[EMAIL PROTECTED] Sent: Friday, February 06, 2004 10:20 AM To: [EMAIL PROTECTED] Subject: Query matching I've been challenged to write a matching query in a project and do not know how to handle a part of it. The criteria are as follows: SELECT * from pages WHERE changelog.agent = pages.agent AND changelog.company = pages.company AND changelog.magazine = pages.magazine Now for the challenging part for me at least. one of the following must at least be true for the query to return a result. changelog.orig_id = pages.mls_1 changelog.orig_id = pages.mls_2 changelog.orig_id = pages.mls_3 changelog.orig_id = pages.mls_4 changelog.orig_id = pages.mls_5 changelog.orig_id = pages.mls_6 changelog.orig_id = pages.mls_7 changelog.orig_id = pages.mls_8 changelog.orig_id = pages.mls_9 changelog.orig_id = pages.mls_10 changelog.orig_id = pages.mls_11 changelog.orig_id = pages.mls_12 Would I nest these as an OR statement and how would I go about it? Thanks, Ed Curtis -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Sorting by more than 1 column
I didn't know if this was possible and haven't tried yet. My boss wants me to sort results by 3 columns (city, county, price.) He would like city and county in alphabetical order a-z and have price from highest to lowest. I told him I didn't think it was possible to sort two different fields one acending and one descending. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
= not working?
I've got an entry in a table where the value is 875. If I run a query on that table with the clause AND sqaurefeet = '$squarefeet' and $squarefeet has a value of say 1000 the row with the squarefeer value of 875 will appear. The column is of type varchar(10) and using the binary flag. What am I doing wrong? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: = not working?
Thanks for the sugestions from all. I just switched the column type to integer. Thanks again, Ed On Mon, 8 Dec 2003, Tobias Asplund wrote: You have a few ways to do this. What's happening here is that you do a comparison in a string context, which means that it will sort according to the ascii values, and 1 comes before 8. To sort the way you want you need to specify to MySQL that you want to do it in a numeric context. You have two simple ways to do this. Add 0 to the string number to force it into numeric mode. AND squarefeet = '$squarefeet' + 0 use the CAST() function, it's described more at: http://www.mysql.com/doc/en/Cast_Functions.html On Mon, 8 Dec 2003, Ed Curtis wrote: I've got an entry in a table where the value is 875. If I run a query on that table with the clause AND sqaurefeet = '$squarefeet' and $squarefeet has a value of say 1000 the row with the squarefeer value of 875 will appear. The column is of type varchar(10) and using the binary flag. What am I doing wrong? Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]