RE: [PHP] Query question

2006-10-30 Thread Ivo F.A.C. Fokkema
On Sun, 29 Oct 2006 23:04:27 -0600, Richard Lynch wrote: On Sun, October 29, 2006 2:06 am, Beauford wrote: LOL, I don't know either. The format is - 01/01/2006. When I first did it I used 7, which should be right, but I ended up getting /2002 /2003, etc. So I went to 8 and all was well.

RE: [PHP] Query question

2006-10-29 Thread Beauford
: PHP Subject: Re: [PHP] Query question Look into the MySQL YEAR() function to extract the year from a specific date. Start here: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html On 10/28/06, Beauford [EMAIL PROTECTED] wrote: I posted this here as I figured I would need

RE: [PHP] Query question

2006-10-29 Thread Robert Cummings
On Sun, 2006-10-29 at 01:05 -0500, Beauford wrote: This is what I finally figured out, which works just perfectly. select count(date) as count, substring(date,8) as year from stats group by year; Thanks to all for the input. So what you're saying is that you're not using a date field,

Re: [PHP] Query question

2006-10-29 Thread Satyam
@lists.php.net Sent: Sunday, October 29, 2006 7:05 AM Subject: RE: [PHP] Query question This is what I finally figured out, which works just perfectly. select count(date) as count, substring(date,8) as year from stats group by year; Thanks to all for the input. -Original Message- From

RE: [PHP] Query question

2006-10-29 Thread Beauford
and all was well. Beats me. B -Original Message- From: Satyam [mailto:[EMAIL PROTECTED] Sent: October 29, 2006 2:14 AM To: Beauford; 'PHP' Subject: Re: [PHP] Query question If that works then you have a problem: you are storing dates as a plain string ( varchar or whatever

Re: [PHP] Query question

2006-10-29 Thread Satyam
went to 8 and all was well. Beats me. B -Original Message- From: Satyam [mailto:[EMAIL PROTECTED] Sent: October 29, 2006 2:14 AM To: Beauford; 'PHP' Subject: Re: [PHP] Query question If that works then you have a problem: you are storing dates as a plain string ( varchar or whatever

RE: [PHP] Query question

2006-10-29 Thread Beauford
] Query question I said that you have a problem,not that you caused it, and my observation might (hopefully) help newbies in the list. Satyam - Original Message - From: Beauford [EMAIL PROTECTED] To: 'PHP' php-general@lists.php.net Sent: Sunday, October 29, 2006 9:06 AM Subject: RE: [PHP

Re: [PHP] Query question

2006-10-29 Thread Ed Lazor
29, 2006 4:30 AM To: Beauford; 'PHP' Subject: Re: [PHP] Query question I said that you have a problem,not that you caused it, and my observation might (hopefully) help newbies in the list. Satyam - Original Message - From: Beauford [EMAIL PROTECTED] To: 'PHP' php-general@lists.php.net

RE: [PHP] Query question

2006-10-29 Thread Richard Lynch
On Sun, October 29, 2006 2:06 am, Beauford wrote: This is how I get the data and I have no control over the actual layout of the database. So I have to work with what I have. When you say it's how you get the data are they handing you a MySQL database that is this badly-constructed? Or are

Re: [PHP] Query question

2006-10-28 Thread Ed Lazor
Use the mysql list :) On Oct 28, 2006, at 3:01 PM, Beauford wrote: Hi, I have a MySQL database with a date field and a bunch of other fields. The date field is in the format - 01/01/2006. What I want to do is query the database and create a table that shows just the year and how many

Re: [PHP] Query question

2006-10-28 Thread Joe Wollard
Agreed, this should go to a MySQL list. But in the spirit of helping I think the following should give you a good starting point. SELECT `year`, COUNT(`year`) AS `count` FROM `tbl` GROUP BY `year` ASC On 10/28/06, Ed Lazor [EMAIL PROTECTED] wrote: Use the mysql list :) On Oct 28, 2006, at

RE: [PHP] Query question

2006-10-28 Thread Beauford
I'd need to use PHP to maybe put it in an array first or something. Thanks -Original Message- From: Joe Wollard [mailto:[EMAIL PROTECTED] Sent: October 28, 2006 10:30 PM To: Ed Lazor Cc: Beauford; PHP Subject: Re: [PHP] Query question Agreed, this should go to a MySQL list

Re: [PHP] Query question

2006-10-28 Thread Joe Wollard
-Original Message- From: Joe Wollard [mailto:[EMAIL PROTECTED] Sent: October 28, 2006 10:30 PM To: Ed Lazor Cc: Beauford; PHP Subject: Re: [PHP] Query question Agreed, this should go to a MySQL list. But in the spirit of helping I think the following should give you a good starting point. SELECT

Re: [PHP] Query Question

2004-08-11 Thread Jason Davidson
whats the error, are there any matching fields for the columns eventetail.event and event.id? Jason Karl-Heinz Schulz [EMAIL PROTECTED] wrote: Why does this query not work? It should only show the eventdetails for the shown event.

RE: [PHP] Query Question

2004-08-11 Thread Karl-Heinz Schulz
Davidson' Subject: RE: [PHP] Query Question Oops - it shows all the eventdetails for all the events -Original Message- From: Jason Davidson [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 10:10 PM To: Karl-Heinz Schulz; [EMAIL PROTECTED] Subject: Re: [PHP] Query Question whats

Re: [PHP] query question

2003-01-14 Thread Jason Wong
On Wednesday 15 January 2003 01:47, Kelly Meeks wrote: I've got an array of values, that I need to query against a database to see if any records have any of the values in the array - the array is a list of zip codes, and the database contains a list of stores. Basically i need to find what

Re: [PHP] query question

2002-11-14 Thread Marek Kilimajer
Untested, but should work Steve Buehler wrote: function getstart_end(){ $result=mysql_query(SELECT * FROM aplayabletimes ORDER BY min); while(($row=mysql_fetch_object($result))){ if(!$i){ echo $row-min . - ; $i=$row-min; }else{ $tmp =

Re: [PHP] query question

2002-11-14 Thread Marek Kilimajer
One mistake Marek Kilimajer wrote: Untested, but should work Steve Buehler wrote: function getstart_end(){ $result=mysql_query(SELECT * FROM aplayabletimes ORDER BY min); while(($row=mysql_fetch_object($result))){ if(!$i){ echo $row-min . - ;

Re: [PHP] query question

2002-11-14 Thread Steve Buehler
Thanks for the help, but that is not actually producing the desired results either. This returns the following results: 00:00:05 - 00:00:05 00:00:05 - 5 00:00:05 - 10 00:00:05 - 15 00:00:10 - 20 00:00:10 - 25 00:00:10 - 30 00:00:10 - 35 00:00:15 - 40 00:00:15 - 45 00:00:15 - 50 00:00:15 - 55

Re: [PHP] query question

2002-11-14 Thread Steve Buehler
Ok. That output was my fault. I had an error in one of my other functions. I needed to set $hours to 00 to start with in my populatetemptable() function. Now my output is: 00:05:00 - 00:05:00 00:05:00 - 00:10:00 00:10:00 - 00:15:00 00:10:00 - 00:20:00 00:15:00 - 00:25:00 00:15:00 - 00:30:00

Re: [PHP] query question

2002-11-14 Thread Marek Kilimajer
This is checked: function getstart_end(){ $result=mysql_query(SELECT * FROM aplayabletimes ORDER BY min); while(($row=mysql_fetch_object($result))){ if(!$i){ echo $row-min . - ; $i=$row-min; } else {

Re: [PHP] query question

2002-11-14 Thread Steve Buehler
Not sure if I wrote and thanked you or not, but this did the trick. THANK YOU THANK YOU THANK YOU!!! Steve At 08:41 PM 11/14/2002 +0100, Marek Kilimajer wrote: This is checked: function getstart_end(){ $result=mysql_query(SELECT * FROM aplayabletimes ORDER BY min);

Re: [PHP] query question

2001-05-21 Thread Markus Fischer
On Mon, May 21, 2001 at 10:36:42AM -0500, Jacky wrote : What do I do if i want to move all values stored in one field to another field in the same table, from field A to field B? Has anyone ever done that? As simple as you think it should be UPDATE table SET column_a = column_b -

RE: [PHP] query question

2001-05-20 Thread Maxim Maletsky
several times: UPDATE table SET B=A; Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Jacky [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 22, 2001 12:37 AM To: [EMAIL