Jump to content

Date range question


raymondm

Recommended Posts

Hi guys, i'm trying to figure out how to do this.

I want to be able to assign users an avatar based on their date of birth.

To be a bit exact i want to be able to assign their zodiac sign to them if they fall within a date range...

Then put a simple tag like  {user.zodiac} to where the image is to show.

 

Any ideas?

 

Link to comment
https://forums.phpfreaks.com/topic/45814-date-range-question/
Share on other sites

You are asking for several differnt things in your question and you have not provided and details abut your current state: i.e. where you are storing the user info, are you already capturing the birth date, etc.

 

If it were me, I would determine the correct zodiac sign at the time I am saving the user record and then save the zodiac name in a column in the user table. Then I would have the zodiac sign images saved in a specific folder according to their name, e.g. images/zodiac/scorpio.jpg"

 

Then when displaying usre information on a page I would first query for the information and then display the zodiac image something like this:

 

<img src="/images/zodiac/<?=$results[zodiac]?>.jpg"

 

If you already have a page set up where you are displaying the user info, then it would be helpful if you posted or attached the current relevant code from that page and any included pages.

Link to comment
https://forums.phpfreaks.com/topic/45814-date-range-question/#findComment-222594
Share on other sites

ok, as it stands i have a mysql database that stores the DOB and groups people by signs in a row called "astrologic_sign" according to their sign example gemini. what i want is to use that info from that row to show an image on the users' page that will be their sign.

 

i'm new to php so i got lost trying to figure out what to write.

Link to comment
https://forums.phpfreaks.com/topic/45814-date-range-question/#findComment-222602
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.