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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.