Thanks, this works great in the MySQL server...I guess
I've never used temp tables before, but when I try to
run this in a PHP script, I get "table does not
exist". How do I do this?
--- Harald Fuchs <[EMAIL PROTECTED]>
wrote:
> In article
> <[EMAIL PROTECTED]>,
t (0.56 sec)
--- Zak Greant <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 17, 2003 at 09:52:44PM -0800, Daren
> Cotter wrote:
> > Jeff,
> >
> > That query simply gives me each mailing ID, along
> with
> > the # of members associated with that mailing ID.
> >
; wrote:
> This should get you close:
>
> SELECT mail_id, count(member_id) AS `# of members`
> FROM yourtable
> GROUP BY mail_id;
>
>
> At 18:44 -0800 3/17/03, Daren Cotter wrote:
> >I have a table that keeps track of when members of
> my
> >site are mailed. Th
I have a table that keeps track of when members of my
site are mailed. The important fields in the table
are: member_id, mail_id
I need to write a query that will return the # of
members and # of mailings, like the table below:
# of mailings sent # of members
-
I have a question regarding tracking multiple referral
levels in a database. The number of referral levels
tracked needs to be at least 4, but should be able to
be expanded later (without modifying the database).
The first design I considered was:
table:
id int(8) unsigned not null auto_incremen
I would use some sort of scripting language (PHP for
example) to format the date, and have that script
import the data into your table, rather than using
LOAD DATA INFILE.
If you post a sample of how your data file is
formatted, someone will gladly help you out. You might
want to post this to the
wrote:
>
>
> Daren Cotter wrote:
>
> > My Linux installation only has about 1gb in the
> /var
> > partition, so I need to relocate my databases to
> the
> > /home partition. I'm pretty sure the following
> > commands will shutdown mysql, move the data
>
My Linux installation only has about 1gb in the /var
partition, so I need to relocate my databases to the
/home partition. I'm pretty sure the following
commands will shutdown mysql, move the data directory,
create a symbolic link, and then restart mysql. My
question is, is this complete, or do I
I have three tables, affiliates, clients, and sales.
The affiliates table stores all of the information about affiliates,
clients about clients, sales about sales. In the clients table, there is
a field for affiliate_id (affiliates refer clients), and in the sales
table there is a field for clien
I have three tables, affiliates, clients, and sales.
The affiliates table stores all of the information about affiliates,
clients about clients, sales about sales. In the clients table, there is
a field for affiliate_id (affiliates refer clients), and in the sales
table there is a field for clien
I probably did not provide enough info the first time. The members table
is setup as follows:
Id (primary key)
Referer (relates to the primary key of the table)
I am given a member ID, say 4. I need to display all members who have
been referred by member 4 (obviously no problem). However, for ea
First off, I would like to thank everyone on this lists who helps people
like myself!
I'm having trouble with the following query:
SELECT username, first_name, email, DATE_FORMAT(signup_date, '%b %e,
%Y') AS signup_date FROM members WHERE referer = (id)
It selects a list of all members from the
t;correct" way to do this?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 6:24 PM
To: Daren Cotter
Subject: Re: Normalization question
Your message cannot be posted because it appears to be either spam or
simply off topic to
I have the following tables:
Member_interests:
Member_id
Interest_id
Interests:
Name
Interest_id
I need a query that selects each interest name, and the # of members who
have selected it...sample output:
Boating 25
Hiking 10
..
Swimming0
Jumping 0
Talking 0
The following query works g
As a follow up to my previous question, two possible solutions came to
mind:
1) Query members table for all members matching criteria stored in that
table (country, marital status, income, etc). Then, take all those
member_ids, and query member_interests table for members who match
there. i.e.,
S
I am having major troubles creating this query...ok here's some
background info:
I have three tables: members, which contains info about the member, such
as city, state, zip, marital status, etc; interests, which stores just
an interest_id and name; and member_interests, which stores just
member_
I need to run a query that selects the usernames of all the members a
particular member has referred on the second level. So member 5 refers
10, 11, and 12, I need the usernames of everyone referred by 10, 11, or
12. Currently I run one query to get 10, 11, 12, make that a string,
then do another
I need to run a query that selects the usernames of all the members a
particular member has referred on the second level. So member 5 refers
10, 11, and 12, I need the usernames of everyone referred by 10, 11, or
12. Currently I run one query to get 10, 11, 12, make that a string,
then do another
What you had looks fine except the date...change what you had to:
AND date >= '2002-03-17'; # date needs quotes around it
Should work.
-Original Message-
From: rory oconnor [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 8:49 AM
To: mysql list (choose midget)
Subject:
I would think the easiest way would be to use the string functions of MySQL
itself...then you don't have the overhead of the PHP application having to
check each row of data (a wise person on this board once answered a question
similar to this for me).
Somthing like...
$query = "SELECT * FROM tb
ED]]
Sent: Tuesday, March 05, 2002 8:27 AM
To: [EMAIL PROTECTED]
Cc: Daren Cotter
Subject: Re: very tough query
Hi Darren,
On Tue, 5 Mar 2002 09:42:50 -0800
"Daren Cotter" <[EMAIL PROTECTED]> wrote:
> mysql> desc poll_questions;
> ++---
ok, here are the 3 tables i have that are related:
mysql> desc poll_questions;
++-+--+-++--
--+
| Field | Type| Null | Key | Default| Extra
|
++-+--+-++
take up way too much disk space?
Sincerely,
Daren Cotter
CEO, InboxDollars.com
[EMAIL PROTECTED]
http://www.inboxdollars.com
(507) 382-0435
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
has anyone ever seen this MySQL error? The database has a high-traffic table
with about a million rows, is this the problem?
Warning: MySQL: Unable to save result set
TIA,
Sincerely,
Daren Cotter
CEO, InboxDollars.com
[EMAIL PROTECTED]
http://www.inboxdollars.com
(507) 382-0435
variable from one page to
another.
Hope that helped!
Sincerely,
Daren Cotter
CEO, InboxDollars.com
[EMAIL PROTECTED]
http://www.inboxdollars.com
(507) 382-0435
-Original Message-
From: David Wolf [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 2:17 PM
To: Steve Meyers; [EM
any
insight as to what may be wrong?
TIA,
Sincerely,
Daren Cotter
CEO, InboxDollars.com
[EMAIL PROTECTED]
http://www.inboxdollars.com
(507) 382-0435
-
Before posting, please check:
http://www.mysql.com/manual.php (th
members table to itself...can anyone help me
out?
i think this is somewhat close:
select 1.member_id, count(*) as count from members as 1 left join members as
2 on 1.referer_id = 2.member_id where 2.first_name is not null;
tia,
Daren Cotter
CEO, InboxDollars.com
http://www.inboxdollars.com
(507
The data wouldn't need to be stored for any longer than two to three months,
so that shouldn't be a problem...what about my query to get all members that
have not read the mailing, is that possible (assuming I don't use the
reverted logic you were talking about).
D
M members WHERE read_array not like '%mail_id%'
Is there any possible way I could accompish this task in one query if I had
this process normalized?
TIA,
Daren Cotter
-
Before posting, please check:
http://www.mys
_id
GROUP BY ad.affiliate_id
ORDER BY count DESC
Note, I want to return all affiliates, even if there are no matching rows in
the advertisers table, which is why I'm assuming a left join is necessary.
TIA,
Daren Cotter
---
just how many m/f and 16-18 yr-olds, 19-24 yr-olds,
etc, but how many of each sex in each age group. I've tried:
DISTINCT(sex, age) ... GROUP BY sex, age
But that doesn't work. Can someone help me out? Can I do this in one Query?
TIA
"or" instead of "and"...this produces invalid results. someone
help please! =)
TIA,
Daren Cotter
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/
comes
subdomain.domain.com.
If anyone could help me out with this query, I'd really appreciate it.
TIA,
Daren Cotter
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/
please tell me if this is optimized?
TIA,
Daren Cotter
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail &l
rname. Here's
the query I tried:
select m.member_id, t.num_questions, r.score FROM members AS m, trivia AS t,
results AS r WHERE m.username = 'username' AND r.trivia_id = 16 AND
r.member_id = m.member_id;
This returns invalid data, however. Can someone please help me out with this
query?
ering which format would be better for the server, assuming there
are upwards of 10,000 member_ids, whether it be one of these solutions or
another one.
TIA,
Daren Cotter
-
Before posting, please check:
http://www.mysq
, '%b %e, %Y') AS signup_date FROM members AS a, members AS b WHERE
a.active_member = 'Y' AND a.ref1 = b.member_i
d GROUP BY a.ref1 ORDER BY count DESC LIMIT 20;
Daren Cotter
CEO, InboxDollars.com
http://www.inboxdollars.com
(507) 382-0435
-Original Message-
From: Paul D
s data. Is this possible to do with one query? If I want to get the
top 100 referers' data, I don't want to do 100 separate queries. Please
help!
Thanks,
Daren Cotter
-
Before posting, please check:
http://www.mys
I have a query I'm sending to the DB...however, instead of having the server
send me the data back, I want to put it into a CSV file for use in an Excel
Spreadsheet. This means either tab-delimited, or separated by commas. Can
someone help?
Thanks,
--
Since I posted so many times about my problem, I feel obligated to notify
everyone I have resolved it, and exactly what was wrong.
I have two fields: last_update, and last_login. Both fields are timestamps,
with defaults of "000". My queries were doing things like:
MONTHNAME(last_logi
Sorry to post AGAIN, but I have new info. I was monitoring the Error Log,
and when I run the query that crashes MySQL, I get the following error:
mysqld got signal 11;
The manual section 'Debugging a MySQL server' tells you how to use a
stack trace and/or the core file to produce a readable back
I have some further information about the problem I'm having. To refresh:
certain queries that used to work on my old server are now failing, giving
me the error:
ERROR 2013: Lost connection to MySQL server during query
TO test the problem, I enabled logging, and was keeping an eye on my log
fil
I recently moved to a new server, and successfully copied the database over
to the new server. However, at least half of my queries are returning the
error:
ERROR 2013: Lost connection to MySQL server during query
The error seems to be random, and only with longer queries. I'm guessing
this is o
I recently just moved my entire site (and all databases) to a new server.
One of the queries I run every day to track inactive members has stopped
working. When I run it from the mysql server, I get the error:
Error 2013: Lost connection to MySQL Server during query
I'm thinking perhaps this is
Since I
didn't use the update_log, all data from today is gone. Live and learn.
Thanks for all your help!
-Original Message-
From: Quentin Bennett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 5:58 PM
To: 'Daren Cotter'; [EMAIL PROTECTED]
Subject: RE: more d
I should note, however, that this query works FINE:
mysql> select count(*) from members where signup_date = '2001-02-28';
+--+
| count(*) |
+--+
| 732 |
+--+
This APPEARS to work, but the "127" should be more like 420
mysql> select count(*) from members where signup
e checked the tables using the checking utility, they show up fine.
What's going on? =)
-Original Message-
From: Quentin Bennett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 4:45 PM
To: 'Daren Cotter'; [EMAIL PROTECTED]
Subject: RE: more date problems
Can you post s
Quentin,
that does not work either, I still get the 125 number, when there are
actually 500 records =(
I am using version 3.22.32
-Original Message-
From: Quentin Bennett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 4:18 PM
To: 'Daren Cotter'; [EMAIL PROTECTE
okay, this is a follow-up to my past email...
since I KNOW more than 122 people have signed up today, I did the following
query:
SELECT signup_date, member_id FROM members ORDER BY member_id DESC limit
200;
there are at LEAST 200 people that have signed up today. however, when i do:
SELECT cou
I have a field in my table that stores the date a member has signed up...i
run a query using distinct to show me how many members signup each day.
Yesterday, our server crashed, and today i am seeing weird behavior with
mysql:
SELECT count(*) FROM members WHERE signup_date = now();
122
SELECT cou
My question is about indexes...basically, I'm wondering how many indexes is
too much, and what the drawbacks are of having more indexes on a table? I'm
guessing INSERT and UPDATE queries probably take longer?
My table has the following fields:
member_id, first_name, last_name, username, password
Someone please help me. This query has always worked until now, now all of a
sudden I get a weird error:
SELECT DISTINCT(signup_date), COUNT(*) AS count,
CONCAT(SUBSTRING(MONTHNAME(signup_date),1,3), ' ', DAYOFMONTH(signup_date),
', ', YEAR(signup_date)) AS signup_date_display FROM members GROUP
52 matches
Mail list logo