473,788 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

arrays, queries, birthdays, ...

hi all,

I have this problem that I cant solve.

I have created an agenda (http://28edegem.scoutnet.be/agenda.php) . The
agenda contains events and birthdays of the members. I query the events and
birthdays per month and sort them on date.
This method works fine for the events since they are all for the same year
(eg 2003) but doesnt work for the birthdays because someone born in
1980-06-23 will be sorted before someone born in 1876-06-05 . This is a big
problem because the person born on the fifth day wont be echo'ed . The
problem can be easily be solved by only requesting the month and day part of
the birthday. I'm not sure this is possible?

If the above doesnt seem to work I can always order the array myself. How
can I access a query array? I guess I can't use the fetch_row ?

kind regards
Stijn
Jul 16 '05 #1
2 2450
Stijn Goris wrote:
[...]
The
problem can be easily be solved by only requesting the month and day part of
the birthday. I'm not sure this is possible?

If the above doesnt seem to work I can always order the array myself. How
can I access a query array? I guess I can't use the fetch_row ?


Better to do it at the database side (for MySQL):

$sql = "select month(birthdate ), dayofmonth(birt hdate), name, address"
." from agenda"
." where public=1"
." order by 1, 2";

--
"Yes, I'm positive."
"Are you sure?"
"Help, somebody has stolen one of my electrons!"
Two atoms are talking:
Jul 16 '05 #2
Stijn Goris wrote:
hi all,

I have this problem that I cant solve.

I have created an agenda (http://28edegem.scoutnet.be/agenda.php) . The
agenda contains events and birthdays of the members. I query the events and
birthdays per month and sort them on date.
This method works fine for the events since they are all for the same year
(eg 2003) but doesnt work for the birthdays because someone born in
1980-06-23 will be sorted before someone born in 1876-06-05 . This is a big
problem because the person born on the fifth day wont be echo'ed . The
problem can be easily be solved by only requesting the month and day part of
the birthday. I'm not sure this is possible?

If the above doesnt seem to work I can always order the array myself. How
can I access a query array? I guess I can't use the fetch_row ?

order by dayofmonth(date )

Jul 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
3685
by: Troll | last post by:
Hi, I need to write a script which reads some data and reports the findings. Just to give you an idea the structure is similar to the following. Data input example: HEADING 1 ********** ColumnA ColumnB ColumnC ColumnD ColumnE
17
2719
by: middletree | last post by:
OK, you pros out there are rolling your eyes at the subject line, but I have never had to use arrays before. The scenario: ASP Intranet app keeps track of trouble tickets for a tech support group. Table called Ticket has one row per ticket. Table named History has 0, 1, or many rows per ticket. As the tech support person makes notes to update the ticket, it adds a new row per entry into History table. One of the things storeed in this...
3
3796
by: Mark | last post by:
Hi From what I understand, you can pass arrays from classic ASP to .NET using interop, but you have to change the type of the.NET parameter to object. This seems to be because classic ASP passes a variant containing an array, and interop expects a parameter of type object if you are passing a variant (you are expected to cast it to the correct type in your code). I'd like to find a way of passing arrays so that you don't need to change...
5
3068
by: Michal Táborský | last post by:
I am wondering, if it's effective to use text arrays to store multilanguage information. We used to do it like this: CREATE TABLE product ( id serial NOT NULL, price float4, ... )
1
2068
by: ferraro.joseph | last post by:
Hi, I'm querying Salesforce.com via their AJAX toolkit and outputting query results into a table. Currently, their toolkit does not possess the ability to do table joins via their structured query language, which forces me to do the join manually via arrays. Right now, I'm having trouble getting these query results (which are in
8
1616
by: mantrid | last post by:
Hello Im having problems working out why the following code does not work. I dont think its the sql as the error occurs on the first update which ever one is put there ($q1 or $q2). Ive swapped then around to test this. Help greatly appreciated The error is Unknown column 'A' in 'field list' but there is no field 'A'. im thinking that the 'A' may be first letter of the word Array, as if it is using this as a variable, but i dont know...
15
449
by: TKirahvi | last post by:
Why can't I create Objects in an Array within for/while loop? If I have: Code: $galleries = array(); while( $db->next_record() ) {
1
1949
by: rpjd | last post by:
I am completely new to this so please bear with me here. My project involves a webpage executing php scripts via an xmlhttprequest which queries a database and returns data to the webpage. This code below is working to a degree in IE7. As I have not yet parsed http.responseText, I am getting all the code in parts.php in the alert. My php script query creates two php arrays, one a single array and a two-dimensional array such as array. My...
6
7593
by: onlyshanks28 | last post by:
Hi I have a database birthday containing name and DOB, I want to find the query which can display 3 latest birth day. I tried select name,date from birthday where month(dob)>=month(curdate()) limit 3; But the problem here is that on 31-December-2008 it will not display the birthdays on January.
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.