Re: Merging deltas from one table to another?

2010-03-10 Thread Don Read
ction side, and then: > > mysql -h test_db_server -h user -pPASSWORD database < /tmp/db.sql ... -- Don Readdon_r...@att.net It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that

Re: Split query result into two part

2010-01-09 Thread Don Read
ELECT name FROM students [ORDERED BY ...]'; $res = mysql_query($qry); for ($cnt=0; $cnt < 5000; $cnt++) { $row = mysql_fetch_array($res); $div1str .= '' .$row['name']; } while ($row = mysql_fetch_array($res)) $div2str .= '' .$row['name&#x

Re: Inserting Multiple Values with Set

2010-01-01 Thread Don Read
uot;, "Extra-small", "'aqua:7FFFD4', 'blue:99'"); > INSERT INTO products ... ..., ('aqua:7FFFD4', 'blue:99')); http://dev.mysql.com/doc/refman/5.0/en/set.html Regards, -- Don Read

Re: two processes update the same column in short time

2009-12-25 Thread Don Read
On Sat, 26 Dec 2009 10:43:55 +0800 Eva said: > 2009-12-26 2:36, Don Read : > > > > > Change noticed to enum('new', 'scan', 'done') not null default 'new'; > > > > When proc two runs, it should > > "UPDATE noticed=&#

Re: two processes update the same column in short time

2009-12-25 Thread Don Read
sing old IPs. > > So how to resolve this problem? > Thanks for my newbie questions. > Merry Holidays! > > Eva. Change noticed to enum('new', 'scan', 'done') not null default 'new'; When proc two runs, it should "UPDATE noticed='sca

Re: Several languages for content

2009-11-27 Thread Don Read
. When the user logs in, it scans all the 'en' (english) tokens and stores it in a PHP array('Day' => 'Day', 'Total' => 'Total' ... Once you figure out the user's locale (either from a user table or parsing the http headers) you re-sc

Re: ad hoc replication for 3 X 40 000 rows

2009-10-21 Thread Don Read
CT ... FROM MSSQL_table WHERE seen='GET'; INSERT INTO MySQL_table ... UPDATE MSSQL_table SET seen='GOT' WHERE seen='GET'; lather, rinse, repeat. -- Don Readdon_r...@att.net It's always darkest before the dawn. So

Re: Slow query Performance

2009-07-16 Thread Don Read
ion is that the query runs faster the second time around but i dont > > have ... > > > > -- > A: It reverses the normal flow of conversation. > Q: What's wrong with top-posting? > A: Top-posting. > Q: What's the biggest scourge on plain text ema

Re: avoiding use of Nulls (was: The <=> operator)

2009-03-15 Thread Don Read
> the NULL handling syntax. > > If you are wondering who Codd is I can anticipate you that he invented the > things we are talking about > (http://en.wikipedia.org/wiki/Edgar_F._Codd) > > > Cheers > > Claudio Nanni And Claudio for the WIN! -- Don Read

Re: query problem

2006-03-12 Thread Don Read
7;$baz%'"; // then test, case by case, to see if you need more selection clauses: if (! empty($area)) $qry = andclause($qry, 'area', $area); if (! empty($interest)) $qry = andclause($qry, 'interest', $interest); echo '', $qry, '&#

Re: Calculating User Ranks (SQL Query Question)

2004-12-24 Thread Don Read
dbconn->Execute($qry); while($row = $r->FetchRow()) $rank[$row['user_id']] = $row['rank']; $dbconn->Execute('UPDATE user SET rank=0'); foreach($rank as $id => $r) { $qry = "UPDATE user SET

Re: Date Indexing

2004-09-23 Thread Don Read
ing similar but with MEDIUMINT. hittime DATETIME NOT NULL DEFAULT '-00-00', prd MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, ... KEY idx_p (prd), ... UPDATE tbl SET prd=EXTRACT(YEAR_MONTH FROM hittime) ... Then query it with SELECT ... WHERE prd=200408 etc. -- Don Read

Re: Doubt about TINYINT type

2004-04-28 Thread Don Read
x27;ve actually specified > a display width, except just to see what effect it has on result > display. :-) > The only time I've used it is in a billing app (w/ zerofill): CREATE TABLE invoice ( id mediumint(6) unsigned zerofill NOT NULL auto_increment, idcust med

Re: What is your mysql debugging strategy?

2004-04-28 Thread Don Read
ith joins etc, I don't find the "your > error near .." very useful or am I giving up to easy? Howzabout : mysql_query($qry) or die(sprintf('Borked query at file %s line %d :%s', __FILE__, __LINE__, nl2br($qry)) .'' .mysql_errno() .'' .mysq

Re: Query question

2004-04-21 Thread Don Read
lowing query: > > SELECT SYS_IDX, LEFT(RIGHT(C, > LENGTH(C)-LOCATE(';',C,LOCATE('name',C))),10) FROM A; > > This return's up to ten characters after the name, somethimes this is > to > much, sometimes to many. Does anybody knows how to go from here.

Re: [Q] moving database to server in new timezone

2004-04-12 Thread Don Read
gt; A. run both servers on the same time-zone. B. load the data and run the query: UPDATE tbl SET ts= DATE_SUB(ts, INTERVAL 10 HOUR) WHERE ... Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going t

Re: counting rows in all tables

2004-03-25 Thread Don Read
On 25-Mar-2004 [EMAIL PROTECTED] wrote: > Not using perl or php I came up with: > > mysqlshow -u user --status db_name | awk -F"|" '{print $2,$5}' | grep > -i pattern > > Is there a query to do the same thing? > > SHOW TABLE STATUS -- Don Rea

Re: How to optimize ugly order by?

2004-03-25 Thread Don Read
DESC, membershiptype DESC -- or -- ELT(membershiptype + 1, '2', '0', '1') ASC -- or -- MAKE_SET(membershiptype, 'a','b') DESC Regards -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn

Re: Connect to MySQL via PHP

2004-02-10 Thread Don Read
raries. To verify this --try this script: --- --- Look for '--with-mysql' in the Configure Command section. Also look for a MySQL Support section. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So i

Re: COMPOSITE PRIMARY KEY?

2004-02-10 Thread Don Read
o! Finance: Get your refund fast by filing online -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- MySQL General Mailing List For l

Re: A "current row updating" counter for a mass "Update" or similar?

2004-02-10 Thread Don Read
with an "Ordered" select, and > then > sending individual "UPDATES" for each Hint: CREATE TEMPORARY TABLE Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal

Re: How to determine when a MySQL database was last modified?

2004-02-06 Thread Don Read
e to maintain a timestamp on each update, and then > go > around all of them at backup time :( > > Anyone got any other ideas? > SHOW TABLE STATUS Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you

RE: Downloading/Exporting delimited text files

2004-02-04 Thread Don Read
quot;\t\"$row["yetnothe > r_fiel > d"]\"\t" ; > $output .=implode("\t", $row) ."\n"; > }// end while Header("Content-type: text/tab-separated-values"); Header("Content-Disposition: inline; filename=data.tsv");

Re: Very big IN ( $value )

2004-01-28 Thread Don Read
idx_hsi (hobby_id, sex, id). At a higher level you might rethink how/why you're doing it that way. This is a subselect done in two steps. Look if you could combine/modify your original query (that produced $value) and this query to a single JOIN query. Regards, -- Don Read

Re: In need of a dummy select statement ...

2003-12-08 Thread Don Read
7;tab' ? > Does it have to be a SELECT? Or just a NO-OP? SET @nothing=0; -or- DO 0; - or - SHOW TABLES LIKE 'asdfzxcv1234'; Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to ste

RE: Mysql server time setting.

2003-11-20 Thread Don Read
gt; > Can anyone help me with this? > In your init script (before the section that calls safe_mysqld) put: TZ=EST; export TZ Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neig

Re: updating records without changing timestamp fields

2003-10-27 Thread Don Read
values created before)? > UPDATE [table] SET [timestamp]=[timestamp], ... Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.

Re: LOAD DATA skips records of text file

2003-10-26 Thread Don Read
e origin input & output files for clues as to what is missing & why. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.

Re: Is there a way to find out if a table exists?

2003-09-19 Thread Don Read
On 19-Sep-2003 Don Read wrote: > > On 19-Sep-2003 Dan Anderson wrote: >> I am trying to make my PHP script autodetect when a table in a mySQL >> database exists, and when it doesn't, create it. >> > > > function tableexists($tbl) { >

Re: Is there a way to find out if a table exists?

2003-09-19 Thread Don Read
On 19-Sep-2003 Dan Anderson wrote: > I am trying to make my PHP script autodetect when a table in a mySQL > database exists, and when it doesn't, create it. > function tableexists($tbl) { $res = @mysql_query("SELECT 1 FROM $tbl"); return ($res ? true : fals

Re: how to 'tell' the select what to omit

2003-08-14 Thread Don Read
can use your language constructs, -- for PHP 'unset($var)' or in Perl 'delete $var'. PHP example: echo ''; $res=mysql_query('SELECT * FROM TName'); while ($row=mysql_fetch_array($res) ) { unset($row['dateOB'], $row['idSCHOOL']);

Re: How to export db or table structure?

2003-07-27 Thread Don Read
command that will export that info to a file > without the contents of the tables themselves? > $ mysqldump -d dbname Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's n

Re: query to find the closest result

2003-07-27 Thread Don Read
.21 | <= Need to eliminate these rows >| 1 | 0 | 5 | 82.87 | <= >| 0 | 0 | 3 | 152.02 | <= >| 0 | 0 | 5 | 138.11 | <= > +++-++ > 6 rows in set (0.00 sec) > > Is it possible to get a result set

Re: MySQL multiple query in php script. (newbie)

2003-07-27 Thread Don Read
;", "Garage > =='".$c."'", > "Basement =='".$d."'"; Use '=' instead of '==' and why the commas in your WHERE clause ? $sql = "SELECT Realtor, ... WHERE Bathrooms ='$a' AND Bedroom

Re: Help with DELETE and a subquery

2003-07-27 Thread Don Read
ed: DELETE FROM clients WHERE cid NOT IN (SELECT b1.cid FROM branches AS b1, branches AS b2 WHERE b1.cid=b2.cid and b1.bid != b2.bid); Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So

Re: Multi-table count

2003-06-25 Thread Don Read
k for 'UNION' and 'MERGE' in the manual. If you're pre 4.0 then: SET @cnt:=SELECT COUNT(*) FROM orders WHERE member_id='2'; SELECT @cnt + COUNT(*) AS totcnt FROM old_orders WHERE member_id='2'; Regards, -- Don Read

Re: Odd characters in my database

2003-06-25 Thread Don Read
ce, but for some reason when executing the SQL query it thinks they > are > the same. Any suggestions would be helpful. > SELECT * FROM tablename WHERE fieldname LIKE CONCAT('%', CHAR(0x??), '%'); UPDATE tablename SET fieldname=REPLACE

Re: Dumping data

2003-06-25 Thread Don Read
$I > $K.$I.sql rm -rf $K.$I.sql.gz gzip $K.$I.sql done done --- Regards -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do

Re: Sorting Countries

2003-06-25 Thread Don Read
, this is my query: > > SELECT countries_id, countries_name FROM TABLE_COUNTRIES ORDER BY > countries_name; "SELECT IF(countries_id='US', 0, 1) as ctsort, countries_id, countries_name FROM TABLE_COUNTRIES ORDER BY ctsort, countries_name" Regards, -- Don Read

Re: about desc command

2003-06-25 Thread Don Read
n DESC tbl; SHOW INDEX FROM tbl; SHOW CREATE TABLE tbl; Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.

Re: Simple Question: MySQL and Shell Scripts

2003-06-24 Thread Don Read
xtfile readable only by you so that you don't > pass the password on the command line. > ~/.my.cnf Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal

Re: Archiving tables ranges

2003-06-23 Thread Don Read
ETWEEN '2003-01-01 00:00:00' AND '2003-06-30 23:59:59'" OPT="-e -q -t" mysqldump $OPT --where="date_time $INPERIOD" db tbl > tbl.dmp && \ mysql -e "DELETE FROM tbl WHERE date_time $INPERIOD" db Regards, -- Don Read

Re: search and replace.

2003-06-20 Thread Don Read
do it, (and > probably faster) to do it in mysql. > > I know how do use the regexp for SEARCHING, but can I do a replace on > the same cmd with an UPDATE? > UPDATE foo SET url=REPLACE(url, 'disciplines/', 'programs/') WHERE url LIKE 'disciplines/%';

RE: Complex SQL involving 10 checkboxes

2003-06-20 Thread Don Read
at > other > times the user will select more than one needing an OR statement between > the > two checkboxes. Make sense? > > Use an array. $agesel=implode("', '", $HTTP_GET_VARS['ageselect,]); $qry="SELECT * FROM foo WHERE penpals.agegro

Re: selecting PRIMARY KEY when there is no unique value

2003-06-19 Thread Don Read
t; > which one do you prefer and usually use? Number one (with a composite key). table invoice_line ( idinv int unsigned not null, // invoice number line tinyint unsigned auto_increment,// line number idprod, qty, uom, price, cogs,

Re: Odd thing

2003-06-19 Thread Don Read
ch day DUMP=$HOME/archive/db DBS="auth gl ar ap inv" DIR=`date +%a` cd $DUMP mkdir -p $DIR rm -f Today ln -sf $DIR Today cd $DIR for K in $DBS do TBLS=`mysql -N -e "show tables" $K` for I in $TBLS do mysqldump -e -q --add-drop-table $K $I >> $K.$I.sql

Re: @@identity

2003-06-18 Thread Don Read
No. The id is per connection. The return value is the last insert performed by your connection. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the ti

Re: probably a stupid question

2003-06-18 Thread Don Read
mn A and insert that into B. > But are there better way's of doing something like this ? > INSERT INTO tbl_B (A_id, ...) VALUES (LAST_INSERT_ID(), ...) Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if

Re: Database Design Question...

2003-06-18 Thread Don Read
hat'll make it easy to rename servers. The table(s) could be populated very easily with a couple of shell, Perl, and/or awk scripts. YP/NIS would come in handy as well. You'd loop on each distinct server name --request a ypxfer of the passwd map, then suck

Re: transactions with php

2003-06-17 Thread Don Read
as a value // assigned. It's not NULL. // -- regardless of what the value is. if ($flag) { -- or (assuming $flag is initialized) -- if ($flag === TRUE) { ... so either would be the correct construct here. Regards, -- Don Read

Re: format a scientific number

2003-06-17 Thread Don Read
@v; +-+ | @v | +-+ | 1.35702e-28 | +-+ 1 row in set (0.00 sec) mysql> SELECT CONCAT(LEFT(@v, 4), 'e', SUBSTRING_INDEX(@v, 'e', -1)) as v; +--+ | v | +--+ | 1.35e-28 | +--+ 1 row in set (0.00 sec) Reg

Re: MySQL and running a function similar to PATINDEX()

2003-06-16 Thread Don Read
ardata SET > author = LTRIM ( RTRIM ( author )), > lname = SUBSTRING ( author, PATINDEX ( '% %', name ) + 1, LEN ( name )), > fname = SUBSTRING ( author, PATINDEX ( '% %', name )); > author =TRIM(author), fname=SUBSTRING_INDEX(author, ' ', 1), lname=SUBST

Re: mysql fails at strat

2003-06-16 Thread Don Read
Table > 'mysql.host' do > esn't exist > 030613 16:36:37 Aborting > Did you run mysql_install_db after installation? Directories in /etc/my.cnf (or command line opts) correct? Regards, -- Don Read [EMAIL PROTECTED] -- It's alwa

Re: DATE

2003-06-14 Thread Don Read
ell; > > But how do I put this value into its corresponding row in the new column > ? > UPDATE dap_cell SET my_new_date= REPLACE(CONCAT(RIGHT(my_date, 4), LEFT(my_date,5)), '/',''); Regards, -- Don Read [EMAIL PROTECTED] -- It&#

Re: CAUTION! ALERT! WARNING! Newbie on board :)

2003-06-08 Thread Don Read
:' .mysql_errno .' ' .mysql_error() .''); B. add a debug function: function debug($fl, $ln, $msg='') { global $debugon; if ($debugon)) { printf("\n\n"; } } $debugon=1; $qry="INSERT INTO foo VALUES('$ba

Re: mysql query output get wrapped

2003-06-04 Thread Don Read
| RE: phonebook | 10 | > ++-+---++++--- > +---+-+ > > *unwrapped* > xterm +aw Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to ste

RE: Displaying numbers with results - any ideas?

2003-06-04 Thread Don Read
to have > something to retrieve to the web page, like PHP, PERL, VBScript, etc. > You can also do the counting there when outputting each row from the > query results. > Or HTML : Ordered (i.e. numbered) lists take the form: ... first list item ... second l

RE: updating database query

2003-06-02 Thread Don Read
[EMAIL PROTECTED] to [EMAIL PROTECTED] Can someone help me out please. > > Thank You > UPDATE datable SET email=REPLACE(email, '@test.com', '@test.ca') WHERE email LIKE '[EMAIL PROTECTED]'; Regards, -- Don Read [EMA

RE: Advice on improving our current method

2003-06-02 Thread Don Read
a number 5 etc. > > Ideally we need to keep using mysqlcc because it is very simple to use, > but it is very time consuming. > > Any suggestions? > > SET @rank:=5; UPDATE music SET chart=0 WHERE [EMAIL PROTECTED]; UPDATE music SET chart=

Re: group by

2003-05-27 Thread Don Read
1 > 3 | Rob |3 > 4 | John |2 > > (Please Note the lack of the "age_range" number 2: 15-29). > SELECT ELT(1+ (age/15), '0-14', '15-29', '30-44', '45-59') AS age_range Regards, -- D

RE: Mixed LEFT and INNER JOINs Report

2003-04-05 Thread Don Read
0 | +----+----+ 4 rows in set (0.02 sec) (BTW, I think your field names are horrid ...) Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that

RE: help deciding on data types

2003-04-05 Thread Don Read
; > Can someone confirm if my maths are all good, and possibly advise any > areas > where I might further optimise this? > > > The only other thing I'm worried about is the fact that I'll have to do a > couple of queries PER HIT using this system (check if the ro

RE: Query formulation question

2003-04-05 Thread Don Read
date range. > > Any help appreciated. > http://www.devshed.com/Server_Side/MySQL/MySQLWiz/page1.html";> Cross-tabulation Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the nei

RE: Selected items delete

2003-04-02 Thread Don Read
; whose "num" field is 4,78,34 and 23, all in one command? Something along > "delete * in 'table' where num=1 and num=13 and num=34" etc. > > Thanks a lot. > > Pag > DELETE FROM tbl WHERE num IN (4,78,34,23) Regards, -- Don Read

RE: Error 28

2003-04-01 Thread Don Read
perror 28 Error code 28: No space left on device localhost.dread$ Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.

RE: Can't create thread error

2003-03-31 Thread Don Read
k, and try a 20 second wait_timeout. The 'ceiling' is 'max_connections' either in one of the my.cnf or as an option in your rc.* scripts. mysql> show variables like '%connect%'; CHECK TABLES been run ? What is Apache's MaxRequestsPerChild s

RE: Can't create thread error

2003-03-31 Thread Don Read
ase let me know. Thanks! > Your pconnects are probably sleeping too long. in /etc/my.cnf: [mysqld] set-variable = wait_timeout=10 That'll get the connections to die off after 10 seconds. If that doesn't take care of it, check your PHP

RE: "mysql_fetch_row" wrong on mysql 3.23.52

2003-03-30 Thread Don Read
;; >$hasil = mysql_query($kalimatsql, $konek); or die("Query problem: " . mysql_error()); > > Thank you very much in advance. > Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the daw

RE: get table name from select staement as output as field

2003-03-29 Thread Don Read
On 30-Mar-2003 Daniel Rossi wrote: > hi guys is this possible ? select tablename1 as table1, id from > tablename1 , tablename2 ? > select 'tablename1' as table1, id from ... Regards, -- Don Read [EMAIL PROTECTED] -- It's always dar

RE: AW: AW: multiple mysqld-max running ?

2003-03-28 Thread Don Read
2881 ?? IN 0:02.04 /usr/local/libexec/mysqld --basedi 2889 ?? IN 0:02.03 /usr/local/libexec/mysqld --basedi 133 con- I+ 0:00.02 /bin/sh /usr/local/bin/safe_mysqld localhost.dread$ Regards, -- Don Read [EMAIL PROTECTED] -- It's always dar

RE: weekly timestamp query

2003-03-28 Thread Don Read
t; column in a format of ("-mm-dd hh:mm:ss") . > WEEK() Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.

RE: Choosing a column for primary key

2003-03-27 Thread Don Read
0 | +--+ 1 row in set (0.00 sec) This works quite well on a site with > 2 million hits/day. --A 'hit' being 1 select and 2 or more inserts. HTH. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So i

RE: Mirroring a table

2003-03-27 Thread Don Read
ion in the website. This is why I'd need > a > "mirroring" feature. > > Any ideas? > > - Ville Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the nei

RE: Fw: Help, Insert not working.

2003-03-27 Thread Don Read
tell me this - 2 hours pissing around for an > oversight. > > TIA > > mysql_query ("INSERT INTO userdata (email, passwd, firstname, alias) VALUES > ('$entered_email','$entered_passwd','$name','Hello')"); &g

RE: sum() using group, and duplicates problems...

2003-03-27 Thread Don Read
ies at :01 and then :59 in the same hour ... And which is more "valid" ? "INSERT IGNORE INTO ... or REPLACE INTO ..." ? Or you could allow both readings and AVG() indstead of SUM() ... Depending on what you'll allow, a full constraint would be: UNIQUE KEY mrph (measuremen

RE: Data entered in PHP not appearing in mySQL

2003-03-26 Thread Don Read
mysql_query($sql, $conn) or die(mysql_error()); > > //echo the result identifier > echo $result; > ?> then View + Source. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal t

RE: Query not returning what I expect....

2003-03-26 Thread Don Read
n SQL Server 7 works fine > SELECT sDAMIONCode, (sORI + ':' + sDamionCode) as sCode FROM tblORI > > Any hints would be appreciated. > MySQL uses CONCAT(sORI, ':', sDamionCode) AS sCode ... Regards, -- Don Read [EMAIL PROTECT

RE: Data entered in PHP not appearing in mySQL

2003-03-26 Thread Don Read
an't see yer code in my crystal ball but the Magic eight-ball sez: 'declare your globals.' Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor'

RE: sum() using group, and duplicates problems...

2003-03-26 Thread Don Read
s. The DISTINCT function filters the result set _after_ they're selected (and SUM'ed). If you have duplicate entries, the sum(val) will total both rows in the group --probably not what you want. A Perl script could help clear up any duplicates. Then you could add a UNIQUE key to keep 

RE: Formatting timestamp in MySQL outfile

2003-03-26 Thread Don Read
mat is '2003123112' > > any help would be greatly appreciated. > > Thanks in advance > anirudh DATE_FORMAT(ts, '%Y-%m-%d %T') Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if

RE: sum() using group, and duplicates problems...

2003-03-25 Thread Don Read
+ 1 row in set (0.00 sec) Since you'll only get 15 significant digits w/ a 64bit float, you're in for considerable margins of error. MySQL is _NOT_ an arbitrary precision calculator. If you need that kind of precision, you should be working with DECIMAL(). Rega

RE: sum() using group, and duplicates problems...

2003-03-25 Thread Don Read
rong, it's always some multiple of 1024 such as 2048. > > *However* SELECT DISTINCT doesn't SEE the duplicates, as so: > > mysql> CREATE TABLE clean_pcf AS SELECT DISTINCT * FROM pcf where release > = > curdate()-1; > Query OK, 2438 rows affected (0.11 sec) &

RE: maintaining delivery order in a table

2003-03-24 Thread Don Read
d,name, (@nc:=ncust) as next from b where [EMAIL PROTECTED] LIMIT 1; ++---+--+ | 7 | bogon |0 | ++---+--+ mysql> select id,name, (@nc:=ncust) as next from b where [EMAIL PROTECTED] LIMIT 1; Empty set (0.00 sec) Regards, -- Don Read

RE: mysqlimport: Error: Can't get stat of

2003-03-24 Thread Don Read
On 24-Mar-2003 James E Hicks III wrote: > mysqlimport: Error: Can't get stat of '/fullpathto/thefile.SQL' (Errcode: > 13), when using table: thefile > localhost.dread$ perror 13 Error code 13: Permission denied localhost.dread$ -- Don Read

RE: mysqldump

2003-03-24 Thread Don Read
ike '%join%'; +--++ | Variable_name| Value | +--++ | join_buffer_size | 8384512| | max_join_size| 4294967295 | +--++ 2 rows in set (0.00 sec) Regards, -- Don Read [EMAIL PROT

RE: IN and comma delimitered id's

2003-03-23 Thread Don Read
64,14,13,15'); +---+ | FIND_IN_SET(4, '64,14,13,15') | +-------+ | 0 | +---+ Regards, -- Don Read [EMAIL PROTECTED] -- It's always da

RE: date problem

2003-03-23 Thread Don Read
()); > +-+---+ >| now() | unix_timestamp(now()) | > +-+---+ >| 2003-03-23 23:07:30 |1048453650 | > +-+---+ > 1 row in set (0.01 sec) >

RE: A query problem...

2003-03-20 Thread Don Read
o > > > WHERE urun.`ID` = depo.`UrunID` > AND depo.`Iptal` = 0 > AND urun.`HizmetUrunu` = 0 > GROUP BY urun.`ID` > > But i dont want to get a row which `Mevcut Miktar`=0 > > How i can modify my query. > HAVING `Mevcut Miktar` <> 0 Regards, -- Don Rea

Re: INTO LOCAL OUTFILE?

2003-03-16 Thread Don Read
cases, that may be sufficient. >> >> mysql -e "select * from tbl_name" db_name > output > > Paul, that works just fine. I note that column names > are inserted as the first line. Is there a way to eliminate > that? If not, that is just fine. > mys

RE: Fw: Swapping around values in a database

2003-03-15 Thread Don Read
> 2,"PASSWORD",10 > 3,"TEXT",30 > > Thanks in advance, > Steve. > > Untested: UPDATE page SET pgposition=IF(pgposition=3, 2, 3) WHERE pgposition IN (2,3); Regards, -- Don Read [EMAIL PROTECTED] -- It's alwa

Re: Updat not Updating

2003-03-15 Thread Don Read
, > $querystring="select * from mytable;"; > echo("\n\n$querystring\n\n"); > mysql_query($querystring); > > will output.. > select * from mytable; > > You can check the syntax of the command this way. > Yep. My

RE: 13: Can't get stat

2003-03-10 Thread Don Read
or is. > I cannot find this error in the docs. > > Greetz, > localhost.dread$ perror 13 2 Error code 13: Permission denied Error code 2: No such file or directory localhost.dread$ Regards, -- Don Read [EMAIL PROTECTED] -- It&#x

RE: Days in a month

2003-03-01 Thread Don Read
0.00 sec) mysql> SELECT TO_DAYS(@e) - TO_DAYS(@b) as FebDays; +-+ | FebDays | +-+ | 28 | +-+ 1 row in set (0.00 sec) Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to

RE: Very basic If statement problem

2003-03-01 Thread Don Read
; > The field is showing the correct field info for applique, they're showing up > as 1,0,1 BUT every one of the designs are showing the message "oops". What > am I doing wrong??? > > TIA > Renee :) > > $vals=array( 'APPLIQUE', 'PUFFY FOAM&#

RE: Deleting records while parsing query results (in Perl DBI)?

2003-03-01 Thread Don Read
qry="SELECT id FROM $tbl WHERE ExpiryDate < DATE_ADD(CURRENT_DATE, INTERVAL 1 WEEK)"; @ids=GetArray($qry); while ( @id= splice (@ids,0,64)) { $weekqry="UPDATE $tbl SET foo='bar' WHERE id IN (" .join(',',@id) .")"; SQLQuery($week

RE: Best way to dump for daily archiving

2003-03-01 Thread Don Read
$DBS do TBLS=`mysql -N -e "show tables" $K` for I in $TBLS do mysqldump -e -q --add-drop-table $K $I >> $K.$I.dmp rm -rf $K.$I.dmp.gz gzip $K.$I.dmp done done --- This gives a 7 day rotation, Mon-Sun

Re: SELECT DISTINCT question

2003-02-27 Thread Don Read
eiving the maximum > royalty, how would I adjust the SELECT statement? > You'll probably need an 'ORDER BY' somewhere in there. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are go

RE: select help

2003-02-26 Thread Don Read
> > result should be = susan > > any help is appreciated > look for 'LEFT JOIN' in the manual. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor

RE: Table Update

2003-02-26 Thread Don Read
can't tell from here, try using some error checking and basic debuging: mysql_connect("$DBHost","$DBUser","$DBPass") or die("Could not connect: " . mysql_error()); $qry="UPDATE items SET ItemSKU='$ItemSKU', ...&

RE: Help needed with SQL...

2003-02-26 Thread Don Read
le, with the DISTINCT function suppressing any duplicates. Clear as mud? (I could've be a little more obvious if I'd put the 'a.memberid=1' clause first. Sorry ...) Regards, -- Don Read [EMAIL PROTECTED] -- It's

  1   2   3   >