Re: Keeping track of database changes

2001-12-04 Thread Steve Werby
n, but I have no experience with them outside of PostgreSQL so I'll let someone else touch on that. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http:

Re: SQL syntax error

2001-11-30 Thread Steve Werby
"Steve Osborne" <[EMAIL PROTECTED]> wrote: > I am receiving the following error when I try to restore a database backup > from an .sql file: > ERROR 1064 at line 12: You have an error in your SQL syntax near > 'PACK_KEYS=1' at line 11 > ) TYPE=ISAM PACK_KEYS=1; > > Cmd used to create sql: > mysq

Re: outer join question

2001-11-30 Thread Steve Werby
believe the joined fields will need to be of the same type. Are they? SELECT val, status FROM A LEFT JOIN B ON val=id -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, ple

Re: Re: in_array function?

2001-11-29 Thread Steve Werby
"Dieter Hansen" <[EMAIL PROTECTED]> wrote: > "Steve Werby" <[EMAIL PROTECTED]> schrieb am 28.11.01: > > "Steve Osborne" <[EMAIL PROTECTED]> wrote: > > > Simple question for one of you I am sure. I'm new to mysql (and php) a

Re: in_array function?

2001-11-28 Thread Steve Werby
1. It returns true if a value is found in the supplied array, false otherwise. 2. See the PHP manual entry for in_array() for details and examples. http://us.php.net/manual/en/function.in-array.php -- Steve Werby President, Befriend

Re: Please redo this horrible web page

2001-11-28 Thread Steve Werby
y cool. > only responses from email address @mysql.com will be read). Too bad you won't see this... -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check:

Re: Duplicate column names

2001-11-09 Thread Steve Werby
ing fields with the same name then you need to preface the field with the tablename so MySQL knows which you are referring to. SELECT tablea.id FROM tablea, tableb; SELECT tablea.id as a_id, tableb.id as b_id FROM tablea, tableb; HTH, -- Steve Werby President, Befriend Internet Service

Re: Large tables

2001-08-09 Thread Steve Werby
table3 WHERE month(dDate)=8 AND table1.key = table2.key AND table1.key = table3.key GROUP BY ... The key will likely be your dDate field. And of course you want to make sure you dDate is indexed, especially for such large tables. -- Steve Werby President, Befriend Internet Services

Re: delete & sub-selects

2001-07-20 Thread Steve Werby
t of id values from the users table in your application. If using PHP an easy way to do is loop through each result, adding to an array then implode the array on "," and save as a $var. Then run the delete with "...WHERE id IN ( $var )". -- Steve Werby Pr

Re: shutdown Mysql

2001-07-19 Thread Steve Werby
"QUAN,SUU (Non-A-PaloAlto,ex2)" <[EMAIL PROTECTED]> wrote: > is there another to shut down mysql, other than ps, then kill? mysqladmin shutdown -- Steve Werby President, Befriend Internet Services LLC http

Re: Storing survey(s) data?

2001-07-19 Thread Steve Werby
; question, what is the best form in which to EXTRACT the data for > running into a desktop graphing program? Write to a file in a public > directory? Sorry, your questions are too vague for me to answer. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.

Re: Upgrade MySQL

2001-07-19 Thread Steve Werby
ql database to whatever directory you chose. > Also it's been recommended to install with the Source instead of the Binary. We > want to enable BDB tables handlers also. I don't know how the RPM version is configured, but you can't go wrong with the source distr

Re: unsuported function

2001-07-18 Thread Steve Werby
d a function called mysql() that is the reason for your error. If on the other hand you didn't paste that error and accidentally typed mysql() instead of whatever really appeared in the error message, perhaps something like mysql_connect() then the problem is you don't have PHP compiled

Re: SQL question (set operator)

2001-07-18 Thread Steve Werby
> Both of the above queries don't work. MySQL doesn't yet support subselects. I believe they're planned for v4.1. > Does somebody have any idea about that? I want to avoid programming the > minus operator in an host language ;-) I think you may have to handle th

Re: How do you insert into two tables at once

2001-07-14 Thread Steve Werby
via a single insert, but not into multiple tables. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.mysql.com/manual.php (the manual)

Re: mysql.org

2001-07-13 Thread Steve Werby
eness of the MySQL software and benefit MySQL AB indirectly regardless of the outcome. Just my 2 cents. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check

Re: Installing, following directions, discovering problems.

2001-06-07 Thread Steve Werby
incorrect system user. Try logging in as "mysql" (or doing "su - mysql" to become mysql) and then try starting mysql. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before

Re: Newbie with PHP

2001-06-05 Thread Steve Werby
code to the list, perhaps someone will help. And before you do, before to echo your SQL statement to the browser so you can see whether it is in fact correct - test by pasting it into the MySQL commandline to ensure it works. -- Steve Werby President, Befriend Internet Services LL

Re: Timestamps

2001-06-02 Thread Steve Werby
her function that returns the difference in time b/w two MySQL timestamps. You should be able to easily modify the first function to suit your needs. You can find both at http://www.befriend.com/code_gallery/php/get_elapsed_time/. -- Steve Werby President, Befriend Internet Services LL

Re: timestamp column

2001-05-22 Thread Steve Werby
the DATETIME field type instead and set the field when the record is created using a MySQL date function or a date function within your programming language of choice. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -

Re: database recovery (errcode 13)?

2001-05-09 Thread Steve Werby
x27; (Errcode: 13) > mysql> I have seen this error when the database (which exists as a directory on the filesystem) or tables (files within this directory) are not owned by the same user that MySQL runs under. It's also possible you would get the same error if that user doesn't

Re: MySQL performance

2001-05-01 Thread Steve Werby
st in many threads - you just need to start searching. http://marc.theaimsgroup.com/?l=mysql -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.

Re: bug report

2001-05-01 Thread Steve Werby
0500 so it gave the currect value. If you want to subtract one day from a date do this: SELECT DATE_SUB( current_date, INTERVAL 1 DAY ); -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -

Re: Why MySQL db will only allow 127 records imported?

2001-04-25 Thread Steve Werby
priate for your dataset. Make it UNSIGNED if you don't expect negative numbers in the ID field. SQL is your friend (added to please the filter). -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -

Re: Joining tables

2001-04-24 Thread Steve Werby
"Marc Raeymaekers" <[EMAIL PROTECTED]> wrote: > I'm a newbie with MySQL, so don't apologize me when I post a stupid question. > > Is it only possible to join tables 2 by 2 or is it possible to join 4 tables in > only one request? Yes, you can join 4 tables

Re: Convert varchar to number field

2001-04-20 Thread Steve Werby
eric type that is appropriate. See the online manual for options. If you're worried you might ruin your data with this conversion first create a copy of the table and experiment on it instead. CREATE TABLE my_copy SELECT * FROM original_table Note that it won't copy the indexes, bu

Re: complicated query

2001-04-20 Thread Steve Werby
columns if the same problem occurs in "subcategory") and assign records with a category of "other" a value of 1 and assign all other records a default value of 0. Let's call the new field "order_1" Then you could construct an

Re: Tables relationships

2001-04-20 Thread Steve Werby
es: MySQL does not have referential integrity. Though it's probably not the answer you want, referential integrity can be accomplished programatically using the programming language you're interfacing MySQL with. -- Steve Werby

Re: MySQL vs SQLServer vs PostgresSQL

2001-04-20 Thread Steve Werby
Postgre gets faster and MySQL adds more functionality perhaps the debate over the better RDBMS will be more interesting. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please ch

Re: recommend a good book for connecting from mysql to other dbs

2001-04-20 Thread Steve Werby
;s impossible to say whether it supports your clients' databases without knowing what they are. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://

Re: Question regarding count(*)

2001-04-20 Thread Steve Werby
the count(*) column. How would i do that?? > ...order by count(*) is not an option because it results > in an error saying that count(*) does not exist. Try aliasing count(*). ..., count(*) AS count ORDER BY count -- Steve Werby President, Befriend Internet Servic

Re: [PHP] select question

2001-04-17 Thread Steve Werby
icks (like `ls -1 $prefix*`) to read the files within the directory containing the database. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http:

Re: Newbie Question!?!

2001-04-16 Thread Steve Werby
s are covered in the online manual. If you're new to databases I suggest learning basic SQL and spending some time reading the MySQL manual. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ --

Re: Books

2001-04-12 Thread Steve Werby
nd MySQL lists many times. Check the archives at http://marc.theaimsgroup.com/ for all the opinions you'll probably ever need. And between the manuals and tutorials all over the web, you might not need any books unless you want to learn how to build web apps while reading on the beach. -- Ste

Re: query memory usage

2001-04-12 Thread Steve Werby
handle, and the process from array? What about performance wise? I am using > perl w/ DBI, but I assume it would be the same if I were using the C api as > well. Processing the records as they are being returned by the query is faster and more efficient than writing the records to an array and th

Re: Select

2001-04-12 Thread Steve Werby
E value >= LOWEND and value <= > HIGHEND Jim didn't want to return records with sequential IDs so that will not work. A few of us suggested using the IN operator, which is the optimal solution. SELECT * FROM table_name WHERE field_name IN (1,3,4); -- Steve Werby President, Befriend Int

Re: No Subject

2001-04-12 Thread Steve Werby
can interact with MySQL databases. As far as making it user friendly for folks from sales, that might be futile. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, plea

Re: Select

2001-04-12 Thread Steve Werby
ows (with > ID's 1-20) > > myarray = (1,3,4) > > I want to return all the fields where ID = 1 and 3 and 4 SELECT * FROM table_name WHERE field_name IN (1,2,3); See the online manual for more details. -- Steve Werby President,

Re: Oops!!

2001-04-12 Thread Steve Werby
Why not send the output of the following to the list: DESCRIBE table_name_here; SHOW INDEX FROM table_name_here; First 5 records from the text file. Command being used to import from the text file. -- Steve Werby President, Befriend In

Re: the quick and the dead...

2001-04-11 Thread Steve Werby
MySQL benchmark may have achieved 1k queries/sec, the type of query involved in a google search is many magnitudes more complex and CPU-intensive. All queries are not created equal. ;-) -- Steve Werby President, Befriend Internet Services LL

Re: the quick and the dead...

2001-04-11 Thread Steve Werby
ands of cheap networked PCs for their search engine. They also employ a number of techniques to reduce the disk seek and query time required. See http://www7.scu.edu.au/programme/fullpapers/1921/com1921.htm for an in-depth article about Google from its creators which I believe was written in 1997.

Re: ID numbers: auto-increment or sequences ?

2001-04-11 Thread Steve Werby
identically structured tables with different AUTO_INCREMENT values set at table creation time and then later insert the records into a third table and retain the incremented values. -- Steve Werby President, Befriend Internet Servic

Re: client problems

2001-04-10 Thread Steve Werby
d not found > error. Did you enter the full path to mysql? Did you go to the directory containing the mysql binary and type "./mysql" (without the quotes)? If not and the directory containing the mysql binary isn't in your PATH then the server won't be able to find the comm

Re: Does anybody know the formula to convert difference of time in decimal

2001-04-06 Thread Steve Werby
t state whether you're using a web scripting language, but if you're using PHP I have a PHP function which I wrote that you could easily edit to do what you're attempting. http://www.befriend.com/code_gallery/php/get_elapsed_time/ -- Steve Werby President, Befriend

Re: Does anybody know the formula to convert difference of time in decimal

2001-04-06 Thread Steve Werby
n. The rest is straightforward. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/

Re: Mysql List Web Archive ?

2001-04-06 Thread Steve Werby
ist (the 2nd URL below): > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) Or you can use a 3rd party archive like: http://marc.theaimsgroup.com/?l=mysql -- Steve

Re: Signal to Noise Ratio...

2001-04-05 Thread Steve Werby
the message and bypass the filtering system (which conceptually a spammer wouldn't do). I'd be glad to help you find a solution. Look at it this way, if you try something and it doesn't work you can always go back to what you have in place now. BTW, I think your company has

Re: date select question

2001-04-05 Thread Steve Werby
complish and explain what the problem is. I'm sure I (and any number of others can help), but I don't understand the problem based on what you've written. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ --

Re: SQL query question?

2001-04-05 Thread Steve Werby
It's not possible to do in one step in MySQL. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ "roger westin" <[EMAIL PROTECTED]> wrote: So a question I have two tables. And i want to... (i just show you) Table 1. OwnerC

Re: Moving MySQL database(s)

2001-04-05 Thread Steve Werby
arch the list archives and manual for more info. This has been covered a lot. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.mysql.com/manual.ph

Re: SELECT and ORDER OPTIONS

2001-04-05 Thread Steve Werby
don't think this is possible in one step using MySQL since the way I know to do it would require a subselect, which is something MySQL doesn't yet support. A solution is to save the output of the above SQL statement into a table (or a temporary table using CREATE TEMPORARY TABLE) and

Re: Math calculations

2001-04-04 Thread Steve Werby
ster to do the calculation within MySQL. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql

Re: Signal to Noise Ratio...

2001-04-04 Thread Steve Werby
t's something to consider since this is a problem with no perfect solution. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.mysql.com/man

Re: Help with SQL

2001-04-04 Thread Steve Werby
s, find only the historical records for a > licenceNo where March is the only record. I didn't sleep last night and it's catching up with me so I can't think SQL right now, but if it can't be done with a LEF

Re: Signal to Noise Ratio...

2001-04-04 Thread Steve Werby
together by http://www.spambouncer.org/ will cut down on the spam. Just my 2 cents. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.mysql

Re: Does query inside while loop slow down page?

2001-04-04 Thread Steve Werby
run once for every record returned from the outer query there might be a better way. If possible, try to use the LEFT JOIN syntax to get the data you want from a single query. LEFT JOIN syntax is covered in the online manual and the list archives. -- Steve

Re: BSDI 4.1

2001-04-04 Thread Steve Werby
It must be installed by the server's root user. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://l

Re: Insert...Select...

2001-04-03 Thread Steve Werby
appens Post to the list the output of: DESCRIBE table1 SELECT * FROM table1 WHERE RecNo = 12 SHOW INDEX FROM table1 and the same for table2. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Befor

Re: I can't remove a user

2001-04-03 Thread Steve Werby
","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y"); > > I tried several sintaxes but none worked. It would be helpful if you posted what you tried. Perhaps try: DELETE FROM user WHERE u

Re: Order by clause for datetime stamp format

2001-04-03 Thread Steve Werby
ould I write the clause to ignore the time portion? See the manual - there are a few dozen built-in date functions. For starters try: DATE_FORMAT( my_date, "%Y%m%d" ) TO_DAYS( my_date ) // only for dates after year 1600 or so, won't give in desired format, but might be faster.

Re: Virtual Domains ?

2001-04-03 Thread Steve Werby
e port to the host as follows hostname.tld:portnum so it's not a huge inconvenience. As a bonus, it adds a layer of security by obscurity because malicious users will need to know the port # MySQL is using. -- Steve Werby President, Befriend Internet Se

Re: Calculations in a field?

2001-04-03 Thread Steve Werby
ould be) then it might make sense to calculate the commission instead of saving it in a field. Then again, if the number of rows is large and reports are going to be generated based on things like total commissions by sales person by month, it might create more overhead than des

Re: Db Efficiency

2001-04-03 Thread Steve Werby
from a parent table (projects) and the matching records from joined tables (history, comments). You can then get everything you need in a single query. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/

Re: Virtual Domains ?

2001-04-03 Thread Steve Werby
, each to run as the system user who will be using each install. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ - Before posting, please check: http://www.mysql.com/manual.php (the manual

Re: [PHP] SQL : multiple SELECT and missing rows.

2001-04-02 Thread Steve Werby
SELECT * FROM accounts LEFT JOIN addresses ON addresses.ID = accounts.ID > Can anyone suggest me how do I SELECT ALL of the accounts having simply NULL > on 'addresses.*' when there's no such row, instead of 'loosing' the whole > 'account' row?

Re: mysql reports time incorrectly.

2001-04-02 Thread Steve Werby
on the bug (which dates back about 2 years if I remember right). You should be able to find it and all of the other posts on the subject from today in the archives at http://marc.theaimsgroup.com/?l=mysql&r=1&w=2. -- Steve Werby President, B

Re: About the upper limit of data storage...

2001-04-02 Thread Steve Werby
tp://marc.theaimsgroup.com/?l=mysql&r=1&w=2 for search phrases like "big table" "2GB", etc. for past discussions on the topic. Also, I believe this is covered in the manual. -- Steve Werby Presiden

Re: Time function

2001-04-02 Thread Steve Werby
"Rekha Das" <[EMAIL PROTECTED]> wrote: > What time function should I use to add 2 hours to a time value I am getting > from the database ? Convert the time to seconds, add 7200 seconds (2 hours), then convert back to time format. SELECT SEC_TO_TIME(TIME_TO_SEC(my_time_fi

Re: Update TimeStamp

2001-04-02 Thread Steve Werby
th type DATETIME and update it when a record is updated or inserted. Then use SELECT MAX(datetime_field_name) and trigger your action based on your criteria. If you are running MySQL with logging you may be able to get update time info. from there as well. -- Steve Werby President,

Re: Newbie question

2001-04-02 Thread Steve Werby
will get you better responses since they can all be important to solving the problem. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ "Graham Nichols" <[EMAIL PROTECTED]> wrote: safe_mysqld --log & I get the error message [[EMAIL PROTECTED]

Re: Calculations in a field?

2001-04-02 Thread Steve Werby
gt; would be. If you're updating existing records use an UPDATE query. UPDATE my_table SET money_made = sales * 0.15; Otherwise, if you're using a programming language like PHP or Perl to access the DB, do something like this. INSERT INTO my_table VALUES ( $sales, $sales * $commission_

Re: backup mysql using crontab

2001-04-02 Thread Steve Werby
gt; but I got nothing in shuncheong.sql file. You need to supply the MySQL username and password to the left of the standard output (">") operator. Try: mysqldump --flush-logs --add-drop-table shuncheong -u root -pmarkloky > /backup/shuncheong.sql -- St

Re: mysqld daemon ended

2001-04-01 Thread Steve Werby
d to run as. If mysql is installed to run as root, then 'su root', if as user mysql, 'su mysql'. It could be a different problem all together, but that's my first guess. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -

Re: most viewed

2001-04-01 Thread Steve Werby
SH 10 > 3 Deftones 45 > > > What's the SQL to select the top 2 most viewed bands SELECT artist FROM my_table ORDER BY views DESC LIMIT 2 -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ --

Re: Still can't get it working.

2001-04-01 Thread Steve Werby
asons, in which case you'd be doing a 'chown -R mysql mysql' in that step. If you're not able to login as the user root, I suggest contacting the system administrator of the server to see if there's a MySQL install available to you or if MySQL can be installed for you to

Re: var directory

2001-03-31 Thread Steve Werby
"Joseph Bannon" <[EMAIL PROTECTED]> wrote: > How do I set the location of the var directory when I > install? ./configure --localstatedir=PATH_TO_DATA_DIR See ./configure --help for more info. -- Steve Werby President, Befriend Internet Services LLC h

Re: flex [was: Odd issue]

2001-03-31 Thread Steve Werby
usr and /var partitions on the Cobalts are pretty small and if you do logging or have large databases the partitions will fill up fast. You might be better off installing onto /home. -- Steve Werby President, Befriend Interne