Re: mysql_fetch_array

2002-02-11 Thread Michael Stassen
On Mon, 11 Feb 2002, [AFQ]T1T4N wrote: dear friends.. i'm doing a simple script that use mysql_fetch_array() and it give me the following error. Warning: Supplied argument is not a valid MySQL result resource in /apache/htdocs/html/intranet.domus.cl/base.php on line 10

Re: Selecting records with the highest value no greater than x

2002-02-15 Thread Michael Stassen
How about SELECT * FROM news WHERE rating = 4 ORDER BY rating DESC, RAND() LIMIT 1; Michael On Fri, 15 Feb 2002, Brent Macnaughton wrote: I need some help here. Let's see if I can clearly describe it. I have a database containing news stories. Each story is assigned a rating (1

RE: Copying the structure of DBs

2002-02-18 Thread Michael Stassen
old_db createdefs.sql to spit out the create table statements for the tables in old_db. Then you could run mysql new_db createdefs.sql to set up identical but empty tables in new_db. You could even save a step with a pipe: mysqldump -d old_db | mysql new_db Michael Stassen University

Re: MySQL Load Data Infile

2002-02-22 Thread Michael Stassen
You need to specify the columns you're loading, if they aren't all the columns in the table in the same order. So, you need to add (date, appleprice, orangeprice,pearprice) at the end of your LOAD DATA INFILE statement. As for only loading one row, I'd guess your input file line endings

Re: Deleting a record

2002-02-22 Thread Michael Stassen
console, it does successfully delete the record. Bye the way, other queries--select and update are working from the perl scripts. Help please. Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED

Re: Beginner needs help

2002-02-25 Thread Michael Stassen
This is the 3rd incorrect answer out of 6 replies to this question. It sure is a good thing we have a manual! Yes, you can insert multiple rows with one INSERT statement. You just have to get the correct syntax. It's INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] tbl_name

Re: need help debugging!

2002-03-01 Thread Michael Stassen
would be this line: ABwhile($num=mysql_fetch_array($search)) { AB ABwhat is wrong with my code? AB AB ABThanks! Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED

Re: NULL timestamps not possible?

2002-03-07 Thread Michael Stassen
the column to NULL for the other cases). Anyway, sigh!. Thanks, -- Shankar. Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED] - Before posting, please check: http

Re: Why v3.23.49 does not build on RedHat 6.2 ?????

2002-03-08 Thread Michael Stassen
and fixed. Has it been? Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http

Re: Perl version of phpinfo()

2002-03-08 Thread Michael Stassen
; $, = \n; print DBI-available_drivers; You should see mysql in the output if the DBD::mysql module is there. Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED

Re: MySQL tables named 'column' cause problems.

2002-03-16 Thread Michael Stassen
He didn't name a column 'column', he named a table 'column'. This may have seemed reasonable given his application. In any case, bad idea or not, his point is well-taken. It worked in one place but not another. While column is a reserved word, the directions at

Re: Compiling on apache.

2002-03-22 Thread Michael Stassen
You have to tell it to use gcc. It doesn't look like you're following the directions for compiling on HP-UX. See http://www.mysql.com/doc/H/P/HP-UX_10.20.html or http://www.mysql.com/doc/H/P/HP-UX_11.x.html If you need help after that, specify your version of HP-UX, version of MySQL,

Re: Grant all on my mysql.*

2002-03-24 Thread Michael Stassen
You set a password for root, so you must use it to connect as root. That is, you must use -p, like this: C:\mysql\binmysql -u root -h localhost -p You'll then be prompted for the password. This is covered in the manual. Michael On Sun, 24 Mar 2002, alan4100 wrote: mysql mysql Grant

Re: SELECT frmo two tables

2002-03-27 Thread Michael Stassen
In my experience, this is frequently the result of a failed connect. Did you verify that the connect statement succeeded? If not, and it didn't, the select will fail, of course, and this is the error you'll get. Mike's advice, checking the value of $position, is also good. By the way, you

RE: Calculate current age with given birthday

2002-03-30 Thread Michael Stassen
On Sat, 30 Mar 2002, Paul DuBois wrote: At 21:25 +0100 3/30/02, Roger Baklund wrote: * Son Nguyen == I tried this query, but... it's not working out: SELECT YEAR(now()-birthday) from users where loginName=test; You are very close: SELECT YEAR(now())-YEAR(birthday) as age from

RE: Calculate current age with given birthday

2002-04-01 Thread Michael Stassen
On Sat, 30 Mar 2002, Paul DuBois wrote: At 17:15 -0500 3/30/02, Michael Stassen wrote: On Sat, 30 Mar 2002, Paul DuBois wrote: At 21:25 +0100 3/30/02, Roger Baklund wrote: * Son Nguyen == I tried this query, but... it's not working out: SELECT YEAR(now()-birthday) from

Re: Redefining data area

2002-04-03 Thread Michael Stassen
Yes, --localstatedir. See http://www.mysql.com/doc/c/o/configure_options.html Michael On Wed, 3 Apr 2002, John Klein wrote: Sorry if this is an obvious question. I swear I RTFMed first. Is there any compile-time option to redefine MySQL's data area (normally mysql-path/var with

Re: ENUM Default values on NULL

2002-04-12 Thread Michael Stassen
Instead of inserting NULL, leave the column out. INSERT mytable (2nd_col_name) VALUES (NULL); If you don't mention the enum column, it gets the default. Michael On Fri, 12 Apr 2002, Ruben I Safir wrote: When I send a NULL it's rejected as bad data, which sort of makes sense On

Re: ENUM Default values on NULL

2002-04-12 Thread Michael Stassen
On Fri, 12 Apr 2002, Steve Katen wrote: Ruben, If you leave it as NOT NULL it should default to NO. If an ENUM is declared NOT NULL, the default value is the first element of the list of allowed values. SIDE QUESTION: Are you doing something like: select * from table where

Re: ENUM Default values on NULL

2002-04-12 Thread Michael Stassen
, other_col) VALUES ('No', NULL); Michael On Fri, 12 Apr 2002, Ruben I Safir wrote: Your example is not the same, it sends only one value to a 2 value table. It definetely does not work if you send NULL INSERT VALUES(NULL) Ruben On 2002.04.12 14:10 Michael Stassen wrote: On Fri, 12 Apr 2002

Re: Qoute

2002-05-10 Thread Michael Stassen
Maybe I'm misreading what you did, but $dbh-quote($group) adds the single quotes around the string, so using it followed by ...WHERE newsgroup='$group' gets you WHERE newsgroup=''name.of.group'' Also, your example sets $newsgroup using quote, but uses $group in the query, which is a problem,

configure/documentation error for HPUX 10.20?

2001-10-29 Thread Michael Stassen
options. I note that every usenet post on building mysql for HPUX 10.20 rI could find ecommends this. Perhaps the HP-UX Version 10.20 Notes should mention this, or, better yet, configure should take care of it. Submitter-Id: submitter ID Originator:Michael Stassen Organization: Indiana

3.23.43 build fails on mysqlbinlog under HPUX 10.20

2001-10-29 Thread Michael Stassen
till it dies, copy the last command, cd client, paste command, add -ldce, and hit enter. Then cd .. and run make again. Fix is to have configure include -ldce in the command to link mysqlbinlog in client/Makefile. Submitter-Id: submitter ID Originator:Michael Stassen Organization: MySQL

3.23.43: using --datadir in configure breaks 'make test'

2001-10-29 Thread Michael Stassen
:Michael Stassen Organization: Indiana University MySQL support: none Synopsis: 3.23.43: using --datadir in configure breaks 'make test' Severity: non-critical Priority: low Category: mysql Class: sw-bug Release: mysql-3.23.43 (Source distribution) Environment

3.23.43 fails merge and some rpl tests on HPUX 10.20

2001-10-30 Thread Michael Stassen
of the need to do this, or a better method, in the documentation. How-To-Repeat: build for hpux 10.20, run 'make test' or run './mysql-test-run --local testname' in mysql-test. Fix: Unknown Submitter-Id: submitter ID Originator:Michael Stassen Organization: Indiana University MySQL

Re: 3.23.43 fails merge and some rpl tests on HPUX 10.20

2001-10-31 Thread Michael Stassen
rpl01, rpl04, and rpl07 now pass. Test merge still fails, however, and the remaining rpl tests (2, 11, 14, mystery22, and sporadic_master) still hang. I'd suggest that configure/make should ensure that all needed permissions are correct. Michael On Tue, 30 Oct 2001, Michael Stassen

Re: Solaris 8 Mysql-3.23.44

2001-11-09 Thread Michael Stassen
in the manual http://www.mysql.com/doc/S/o/Solaris.html: CC=gcc CFLAGS=-O3 \ CXX=gcc CXXFLAGS=-O3 -felide-constructors -fno-exceptions -fno-rtti \ ./configure --prefix=/usr/local/mysql --with-low-memory --enable-assembler Michael === Michael Stassen University Information Technology

Re: Re: String Comparision

2001-11-26 Thread Michael Stassen
] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED] - Before posting, please check: http

Re: LIMIT by column return

2001-11-29 Thread Michael Stassen
out the MySQL site without any luck. Thanks, Tom Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php

RE: compile problems on Solaris8

2001-11-30 Thread Michael Stassen
-mail: [EMAIL PROTECTED] Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http

RE: compile problems on Solaris8

2001-11-30 Thread Michael Stassen
I don't think the manual page at http://www.mysql.com/doc/S/o/Solaris.html is much help here. It mentions setting ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'} in your config.cache in case of a particular error, not the one reported here. I think I remember reading

Re: compile problems on Solaris8

2001-11-30 Thread Michael Stassen
-compiler. Certainly, the test you show here could not show more than whether or not the compiler works. Perhaps the next release of mysql could have a better error message from configure. Michael On Fri, 30 Nov 2001, Philip Molter wrote: On Fri, Nov 30, 2001 at 11:56:05AM -0500, Michael Stassen

Re: Coredump when running scripts/mysql_install_db

2001-12-04 Thread Michael Stassen
A couple of others have reported this in the last month. I reported what I believe to be the same problem on Mon, 29 Oct 2001 with mysql 3.23.43 built from source with gcc 2.95.3 according to the instructions in the manual. I believe the problem is that enabling largefile support, as is done

[OT] Re: compile problems on Solaris8

2001-12-04 Thread Michael Stassen
On Tue, 4 Dec 2001, George Horvath wrote: Michael Widenius wrote: Hi! Michael == Michael Stassen [EMAIL PROTECTED] writes: cut Michael * everyone who has reported this was using the precompiled binary of gcc Michael (either 2.95.2 or 2.95.3) from Sunfreeware

[OT] Re: compile problems on Solaris8

2001-12-04 Thread Michael Stassen
a pain for several applications. (OpenSSH, etc). Matt. George Horvath wrote: Michael Widenius wrote: Hi! Michael == Michael Stassen [EMAIL PROTECTED] writes: cut Michael * everyone who has reported this was using the precompiled binary of gcc Michael (either

Re: Searching for partial dates

2001-12-10 Thread Michael Stassen
Is the date really stored as an integer? You say so, but then you're trying a wildcard (i.e. char) search. If so, try this (pretending date_int is your date stored as an integer column in the table large_table):

Re: Coredump when running scripts/mysql_install_db

2001-12-14 Thread Michael Stassen
On Fri, 14 Dec 2001, Michael Widenius wrote: Hi! Michael A couple of others have reported this in the last month. I reported what Michael I believe to be the same problem on Mon, 29 Oct 2001 with mysql 3.23.43 Michael built from source with gcc 2.95.3 according to the instructions

Re: Coredump when running scripts/mysql_install_db

2001-12-18 Thread Michael Stassen
On Sun, 16 Dec 2001, Michael Widenius wrote: cut As this works on our HP-UX machine, it means that some library that we are using is not compatible with yours :( Michael My workaround is to compile mysql from source, adding --disable-largefile Michael to the options recommended in the

Re: Coredump when running scripts/mysql_install_db

2001-12-18 Thread Michael Stassen
While I have your attention, let me take this opportunity to report that I've run into quite a few obstacles building MySQL from source. (I reported most of these at the end of October, but have received no response.) 1) Back in August (8-8-2001, in thread Build problems (+solution) on

Re: Coredump when running scripts/mysql_install_db

2001-12-20 Thread Michael Stassen
On Thu, 20 Dec 2001, Michael Widenius wrote: Hi! Michael == Michael Stassen [EMAIL PROTECTED] writes: CUT Michael 2) While this worked for 3.23.41, I cannot believe it has worked for you Michael since 3.23.43. It doesn't for me. The problem is that somewhere between Michael 41 and 43

Re: Coredump when running scripts/mysql_install_db

2001-12-20 Thread Michael Stassen
After applying your patch to my copy of 3.23.46, I get mysqld.cc: In function `void kill_mysql()': mysqld.cc:622: `kill_server_thread' undeclared (first use this function) mysqld.cc:622: (Each undeclared identifier is reported only once mysqld.cc:622: for each function it appears in.)

Re: Changing part of field

2002-01-04 Thread Michael Stassen
to the pertinent section of the manual would be most helpful. -- Greg Peretti web developer www.abqjournal.com (505) 823-3888 Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED

Re: just got this through whats going on ???

2002-01-07 Thread Michael Stassen
The unsubscribe request came from [EMAIL PROTECTED] according to the headers. I'd bet this was an accident. The same thing happened to me a while back. If you'll look at the bottom of my reply, you'll notice that *my* unsubscribe info is included. (Usually, I cut that section out of my

Re: Importing of text fails on incompatible date fields.

2002-01-08 Thread Michael Stassen
*** *** [EMAIL PROTECTED] Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED] - Before posting, please check: http

Re: Can't untar mysql on Solaris 8

2002-01-30 Thread Michael Stassen
Solaris tar is broken (can't handle long file names). You need to use GNU tar. See http://www.mysql.com/documentation/mysql/bychapter/manual_Installing.html#Solaris Michael On Wed, 30 Jan 2002, Eurico de Sousa wrote: Hi. I've downloaded the .tar.gz files for MySQL 3.23.48, 3.23.47 and

Re: urgent respnse

2002-01-30 Thread Michael Stassen
On Tue, 29 Jan 2002, Sasha Pachev wrote: On Tuesday 29 January 2002 06:20 pm, Michael Widenius wrote: I think we can avoid things like this by adding some extra 'not- allowed-on-the-list' words, that a non-subscribe can't use, without including an extra keyword in the email. Sasha,

Re: enum for bool in the future

2003-09-11 Thread Michael Stassen
Abs wrote: hi i know this has been discussed before, storing bools in the right column type. in the case of enum as: enum(N,Y) or n,y, etc. it might be easy to read when u're looking at the database table itself, but if u had to communicate this properly to other programmers designing a front-end,

mysql 4.0.15: configure fails

2003-09-11 Thread Michael Stassen
I have Mac OS X 10.2.6 with December 2002 Dev Tools and the Dec 2002 gcc updater, which means I'm using gcc 3.3. Following the directions in INSTALL-SOURCE, I ran configure with: CC=gcc \ CFLAGS=-O3 -fno-omit-frame-pointer \ CXX=gcc \ CXXFLAGS=-O3 -fno-omit-frame-pointer -felide-constructors

Re: mysql 4.0.15: configure fails

2003-09-12 Thread Michael Stassen
Lenz Grimmer wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, On Fri, 12 Sep 2003, Michael Stassen wrote: I have Mac OS X 10.2.6 with December 2002 Dev Tools and the Dec 2002 gcc updater, which means I'm using gcc 3.3. [...] I assume you mean the August 2003 updater? This is the one

Re: FULLTEXT search oddity

2003-09-19 Thread Michael Stassen
This doesn't surprise me. I haven't looked at the code, but I'd bet that double-quoted, exact phrase matches are handled the usual way by mysql: First, do a regular fulltext search (using the index) to find rows with your search words, then check the found rows to see if they exactly contain

Re: FW: MySQL not null vs MSAccess required

2003-10-07 Thread Michael Stassen
Cal Evans wrote: I humbly submit an apology. You are correct. This is a bug (No it is NOT a feature) While you may not like it, this definitely is a feature (or an intentional design decision, at least), not a bug. See the docs at http://www.mysql.com/doc/en/constraint_NOT_NULL.html. The

Re: FW: MySQL not null vs MSAccess required

2003-10-08 Thread Michael Stassen
refers to NULL values on a logical sentence, e.g. If(something=NULL...) How do I get TRUE on a logical sentence if I want to refer to it as If it is NULL do...? Thanks on advance, Miguel Ernesto -Mensaje original- De: Michael Stassen [mailto:[EMAIL PROTECTED] Enviado el: Martes, 07 de Octubre de

Re: User can see all databases...

2005-12-14 Thread Michael Stassen
William R. Dickson wrote: OK, I strongly suspect I've just done something stupid here, but I'm having trouble figuring it out. I had a disk go bad on a MySQL server this past weekend. I did a clean system install (FreeBSD 5.4) on a new disk, installed the MySQL 3.23 port, and restored the

Re: Need Help Connecting

2005-12-22 Thread Michael Stassen
Mark Phillips wrote: David, This is what I got: [EMAIL PROTECTED]:~$ aliases bash: aliases: command not found Your shell is bash, so the correct command is `alias`. [EMAIL PROTECTED]:~$ which mysql /usr/bin/mysql Since you are using bash, it's a better idea to use `type` instead of

Re: backslash and Update

2005-12-30 Thread Michael Stassen
Danny Stolle wrote: Hi, What you perhaps could use is the REGEXP usage in your where clause. Try this: update name set first_name=replace(first_name, '\\', '') where first_name regexp ''; The fun thing is that when you put '\\' instead of the '' after the regexp function it doesn't

Re: SELECT help.

2006-01-05 Thread Michael Stassen
Richard Reina wrote: Can someone help me write a query to tell me the customer numbers (C_NO) of those who've had more than 4 transactions but none in the last 6 months? transactions_table | ID | C_NO |DATE | AMOUT | | 2901 | 387 | 2003-10-09 | 23.00 | Obviously my

Re: Getting # of days until expiration

2006-01-05 Thread Michael Stassen
Brian Dunning wrote: Thanks Peter, that appears to be exactly what I'm looking for, but it still gives an error and I've been through it with a fine-toothed comb, tried different versions, parens, etc. Here is the exact SQL statement I'm using, with your suggestion: select

Re: Help with a SELECT query

2006-01-06 Thread Michael Stassen
Jay Paulson (CE CEN) wrote: This helps a ton! Thanks! I didn' tknow about the INET_NTOA() or the INET_ATON() functions. That is much quicker to query on them than on a char set of ips. However, I did notice on the mysql web site that these functions are only available in 5.x but the way the page

Re: Sorting with NULL

2006-01-09 Thread Michael Stassen
Marcus Bointon wrote: I have a table that contains a foreign key that can be null. When I do a search I want to have the matches that are null appear first, and then all other values sorted by another column. My data looks like this: idname nullabc 1def 2xyz nullzzz 7

Re: Performance Problem on query kind of like a group by

2006-01-12 Thread Michael Stassen
Jim Tyrrell wrote: Everyone, I finally feel let down by mysql after 5 years of great use. I break most things in weeks so this is a heck of a record. I am sure I am being a dummy on this, but am wondering if there is some setting somewhere to help out a query like this. Given a table like

Re: Query Question

2006-01-16 Thread Michael Stassen
Douglas S. Davis wrote: Hi, If the following isn't appropriate, please feel free to ignore. The program I'm referring to is written in Perl and uses a MySQL database, so I thought perhaps it would be appropriate for this list. I have a webpage that displays a user's profile by selecting

Re: Need help with a query

2006-01-23 Thread Michael Stassen
Mark Phillips wrote: I am running mysql 4.0.24 on Debian sarge. I have a table with two columns, team and division, both varchar(255). There are some errors in the table where division has a value but team is blank. Given that I am getting new data, and the data entry folks may create a

Re: count(*) send a wrong value

2006-01-23 Thread Michael Stassen
fabsk wrote: Hi, I'm facing a strange problem. I am using a database at my Internet provider (Free, France). The type of table is MyISAM (no choice), MySQL 4.1.15. I can do my tests with my PHP code or phpMyAdmin. The definition of my table is: - uid, int - cid, int - response, text -

Re: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Michael Stassen
George Law wrote: Nicolas, Not sure when the replace function was introduced into mysql, but I think it might do... REPLACE() exists in 3.23. Use replace in your order by, replacing a-z with null chars, leaving just your numeric digits, then order by Easier said than done. select *

Re: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Michael Stassen
Nicolas Verhaeghe wrote: Thanks, but unfortunately the replace function does not want to work on a regexp in version 3.23... or 4.0, or 4.1, or ... I guess I'll have to create a displacement field and populate it from the admin tool. Well, that's the right way to go. You're seeing the

Re: How can I isolate the integer part of a varchar field and use it in an ORDER BY?

2006-01-24 Thread Michael Stassen
Nicolas Verhaeghe wrote: Because I am currently stuck with 3.23 I have just decided to create a displacement field to isolate the number. That's the right way to go, regardless of version. Besides, some of these bikes escape from the rules, for instance instead of 600 for 600cc, you only

Re: Sort before grouping

2006-01-30 Thread Michael Stassen
David Förster wrote: Hi, is there any way to get datasets sorted before they're grouped by GROUP BY()? I have a table of events at different locations and want to select the newest one for each location. However SELECT * FROM events GROUP BY location ORDER BY date DESC gives me just some

Re: Help Understanding Document Syntax

2006-01-30 Thread Michael Stassen
Rhino wrote: The 'symbol' you are referring to, in the foreign key clause of the CREATE TABLE statement, is simply an opportunity for you to choose a name for the foreign key of the table; if you don't choose a name, MySQL will generate a default name for you. Therefore, if you do this:

Re: Help on Unknown field error

2006-01-30 Thread Michael Stassen
pedro mpa wrote: Greetings. I need help on the following query. I get an error like Unknown/Invalid column total_price [...] when I try filter by total_price. How can I do this correctly? SELECT receipts.*, (SELECT SUM(receipt_itens.price) FROM receipt_itens WHERE

Re: Help Understanding Document Syntax

2006-01-31 Thread Michael Stassen
Rhino wrote: First and foremost, thank you very much Michael for correcting my mistakes; I _was_ a bit sloppy in my reading of the syntax for the statements and that caused some unnecessary errors in my reply to Scott. However, your corrections are not _quite_ right even now. See below where

Re: Creating REGEXP patterns with use of subquery

2006-02-03 Thread Michael Stassen
Kim Christensen wrote: Is there any way to build a REGEXP pattern set by using a subquery? I have a set of rows in table table, with the column value being target for my query. That column's content is a bracket separated list of values, like this: [118][Word][Integer][Stuff]... [67][Another

Re: MySQL says, Ich don't think so (Subquery woes)

2006-02-04 Thread Michael Stassen
René Fournier wrote: SELECT MAX(id) FROM history WHERE account_id = 216 GROUP BY asset_id ...works. Returns, e.g.: 1234, 3456, 5483, 8382. SELECT history.* FROM history WHERE history.id IN (1234, 3456, 5483, 8382 ) ...works too. But if I try to combine them using a subquery, a la... SELECT

Re: Can't Create Foreign Key Constraints

2006-02-07 Thread Michael Stassen
Lola J. Lee Beno wrote: I'm trying to create foreign key constraints and keep getting an error message 1005 (I did look it up, but didn't see an obvious solution to fixing this for my database). The version I'm using is 5.0.17-max. I used Mysql WorkBench to create the database schema and

Re: Column in field list is ambiguous

2006-02-08 Thread Michael Stassen
Grant Giddens wrote: Hi, I'm using mysql 4.1.14 and and getting this error: Column 'asin' in field list is ambiguous This is the query that is giving me the error: SELECT pn_pricecompare_searchdata.prod_id, MATCH (asin,upc,...) AGAINST ('warcraft' IN BOOLEAN MODE) AS score

Re: How to select data if not in both tables?

2006-02-11 Thread Michael Stassen
Bob Gailer wrote: Peter Brawley wrote: Grant, If I want to select all the products that are in the product_table, but not in the sale_table, how to make the query? The product_table has all the products, but the sale table is a subset of the product_table. SELECT * FROM product_table p

Re: Returning values from an INSERT

2006-02-11 Thread Michael Stassen
bob pilly wrote: Hi everyone, im new to SQL and have a question that someone can hopefully answer If i am inserting a new record into a table that has an auto_increment field in it, is it possible to get the value of that field returned automatically instead of having to do a SELECT..

Re: Timestamp error

2006-02-12 Thread Michael Stassen
pedro mpa wrote: Greetings! I am building a website using MySQL 5.0.18 and PHP 5.1.2. When I try to insert in a table a timestamp value from php's mktime() I get the following error: 1292: Incorrect datetime value: '1139776424' for column 'access_date' at row 1 The sql for the table is: CREATE

Re: getting COUNT() TO return 0 for null matches in a query, how?

2006-02-26 Thread Michael Stassen
Ferindo Middleton Jr wrote: I have the following query which counts the records from a table called registration that have an schedule_id that matches a record in another table called schedules. The below query works fine but how can I get it to return a COUNT() of 0 each instance where there

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Michael Stassen
Søren Merser wrote: Hi, I'll try I need one record for each id in the tabel, i.e. NO duplicate id's with TYPE set to 4 or NULL Now, the TYPE of id 2 is 4 so I peserve it; As id 2 has more than one entry I have to delete it/them Id's with TYPE = NULL (id 1,4,5)is kept Id 5 (and 6) has two

Re: Help on sql statement (not MySQL specifik)

2006-03-05 Thread Michael Stassen
Rhino wrote: I don't really understand _why_ you want to do this but here is a query that gives the result you want: select id, case type when 4 then 4 else null end as type from Soren01 group by id; The GROUP BY ensures that you get one row for each value of id; the case expression in the

Re: SQL Foreign Key

2006-03-12 Thread Michael Stassen
Andreas Krüger wrote: 1) Sorry for not giving you the version: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. *mysql SELECT VERSION(); +---+ | VERSION() | +---+ | 5.0.17-nt | +---+* 1 row in set (0.00 sec) snip InnoDB Status after

Re: Checking for good update

2006-03-12 Thread Michael Stassen
fbsd_user wrote: Using this code I get this error message. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/local/www/data/mls_verifyemail.php on line 49 What code should I use to check if the update worked or not? Your second line does just that.

Re: Checking for good update

2006-03-12 Thread Michael Stassen
[EMAIL PROTECTED] wrote: looks a bit strange to me. $result = mysql_query($query) or die('Query couldn\'t executed:'.mysql_error()); please try something like this: Why? There's nothing wrong with the above statement. // build the query - (that's OK) $query = UPDATE members SET

Re: Checking for good update

2006-03-13 Thread Michael Stassen
[EMAIL PROTECTED] wrote: On Sun, 12 Mar 2006, Michael Stassen wrote: [EMAIL PROTECTED] wrote: looks a bit strange to me. $result = mysql_query($query) or die('Query couldn\'t executed:'.mysql_error()); please try something like this: Why? There's nothing wrong with the above statement

Re: update using 'set' keyword

2006-03-13 Thread Michael Stassen
fbsd_user wrote: Trying to bump the count_of_logons by 1 using this update. Phpmyadmin shows the count staying at zero. I think that this SET count_of_logons = 'count_of_logons + 1' is not coded correctly, but I get no errors so can not tell. Anybody have any ideas? The table def has

Re: Query Optimization Question

2006-03-13 Thread Michael Stassen
Robert DiFalco wrote: In a previous database engine I was using an IN was more optimal than a . So, for example: SELECT * FROM table WHERE table.type IN (1,2,3); Where the possible values of type are 0-3, was appreciably faster than: SELECT * FROM table WHERE table.type 0; I've

Re: Query Optimization Question

2006-03-14 Thread Michael Stassen
[EMAIL PROTECTED] wrote: Yes, a ranged query should respond faster than a negation. In some cases you can seriously improve query performance for a negation query if you split it into two range queries unioned together. Here is a pseudo example: This query should be slow due to the table

Re: problem with selecting my max bid ..

2006-03-16 Thread Michael Stassen
Gregory Machin wrote: Hi. I have the following table | bid_id | dealer_id | auto_dealer_id | auto_id | bid_amount | timestamp | Bid_Status | +-+-+--++-++-+ | 1 |3 |

Re: problem with selecting my max bid ..

2006-03-17 Thread Michael Stassen
Gregory Machin wrote: Ok I tried the following SELECT dealer_id, auto_id, bid_amount FROM bids WHERE bid_amount=(SELECT MAX(bid_amount) FROM bids WHERE auto_dealer_id='3'); which gives +---+-++ | dealer_id | auto_id | bid_amount | +---+-++

Re: Full outer join

2006-03-19 Thread Michael Stassen
Maurice van Peursem wrote: Hello, I like to have a full outer join. if you have the following tables: t1: id | val 1 | A 2 | B t2: id | val 1 | B 2 | C SELECT t1.id, t2.id, t1.val FROM t1 FULL OUTER JOIN t2 ON t1.val=t2.val ORDER BY t1.id,t2.id I want to get the following result

Re: Date Field Reverting to 0000-00-00 Format

2006-03-25 Thread Michael Stassen
Lola J. Lee Beno wrote: I have a bunch of data where one of the columns is a date field. Here's a sample of the data that I have: 141415010001 02005-01-15 10:15:42.41837 281512010002 02005-01-15 10:22:37.756594 36

Re: Find records not in many-to-many table?

2006-03-25 Thread Michael Stassen
barney wrote: Thanks, Stefan, But that only works if both tables have the same field name, doesn't it? If I use select FileKey from dl_files left join dl_merges using (FileID) where FileID is null MySQL returns Unknown column 'articles.dl_files.FileID' in 'on clause'. Correct me if I'm wrong,

Re: getting started with mysql

2006-03-26 Thread Michael Stassen
Michael Friendly wrote: I've just started trying to use mysql (debian/linux 4.0.24_Debian-10sarge1-log), which I'm finding quite frustrating. I have a bunch of .csv files to try to import. They all have a first line containing field names. When I try load data ... I get errors no matter what

Re: Date Field Reverting to 0000-00-00 Format

2006-03-26 Thread Michael Stassen
Lola J. Lee Beno wrote: snip Here's an example of one of the tables where the date was retained successfully, with the string to the right of the decimal point being trimmed: 1Cobweb2005-01-13 15:21:50.654149 2Lace Weight2005-01-13 15:21:50.654149 3Sock2005-01-13

Re: Client does not support authentication protocol requested by server

2006-03-26 Thread Michael Stassen
Andrew wrote: In the last episode (Mar 26), Andrew said: What could ever be the problem with the failing Perl DBI (C-B) connection, if everything is OK with a C-A connection (with and without Perl), and, in addition, a command-line C-B connection works? The password on B is a new-style

Re: deadlock - further information

2006-03-26 Thread Michael Stassen
Rithish Saralaya wrote: snip in 4.1.xx, you can use the my.cnf option innodb_locks_unsafe_for_binlog to make InnoDB to use a consistent read in the SELECT tables in CREATE ... SELECT. Read the caveats about the my.cnf option, though. Thanks. However, whatever is written in

Re: newbee error (1044)

2006-03-26 Thread Michael Stassen
Shawn Sharp wrote: I get the following error while trying to create the following database mysql mysql zm_cre­ate.sql.in ERROR 1044 (42000): Access denied for user ''@'­loc­al­host' to database 'mysql' You are logged into mysql as the anonymous user, ''@'­loc­al­host'. By default, the

Re: newbee error (1044)

2006-03-26 Thread Michael Stassen
Shawn Sharp wrote: Dilipkumar, Thanks much for the tipit did the job! Now we query mysql to see if the new mysql database is seen by mysql and it still only sees test: No, you can't see the mysql db, because you don't have permission to access it. I expect you are still logged in as

Re: Reply / Return Address of this List

2006-04-18 Thread Michael Stassen
[EMAIL PROTECTED] wrote: The battle has been fought before - and the list administrator has given his reasons why he has not made the requested change. The way the list currently behaves is not an accident or omission, but a deliberate decision. I do not recall the grounds for that decision -

Re: WHERE doesn't work

2006-04-21 Thread Michael Stassen
Tom Lobato wrote: From: Nicolas Verhaeghe [EMAIL PROTECTED] Echo the UPDATE query itself and then copy/paste it here that way we'll see what is wrong. I already tried it. See some msgs before this. No sucess. When I paste the exactily same command to the mysql client, all works fine

  1   2   3   4   5   6   7   8   9   10   >