Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 755577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:08:44+00:00 2026-05-14T15:08:44+00:00

I want to be able to separate the birthday from the mysql data into

  • 0

I want to be able to separate the birthday from the mysql data into day, year and month.
Using the 3 textbox in html. How do I separate it? I’m trying to think of what can I do with the code below to show the result that I want:

Here’s the html form with the php code:

$idnum = mysql_real_escape_string($_POST['idnum']);

mysql_select_db("school", $con);
  $result = mysql_query("SELECT * FROM student WHERE IDNO='$idnum'");

  $month = mysql_real_escape_string($_POST['mm']);
?>       
<?php while ( $row = mysql_fetch_array($result) ) { ?>
    <tr>
    <td width="30" height="35"><font size="2">Month:</td>
    <td width="30"><input name="mo" type="text" id="mo"  onkeypress="return handleEnter(this, event)" value="<?php  echo $month = explode("-",$row['BIRTHDAY']);?>">

As you can see the column is the mysql database is called BIRTHDAY. With this format:

YYYY-MM-DD

How do I do it. So that the data from the single column will be divided into three parts?
Please help thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:08:45+00:00Added an answer on May 14, 2026 at 3:08 pm

    You can use list and explode to get desired result

     list($year,$month,$day)=explode("-", $row['birthday']);
    

    hence $year contains year, $month contains month and $day contains Day, you can use it like this in your text boxes

    <input name="mo" type="text" id="mo" value="<?php echo $month;?>">
    <input name="dt" type="text" id="dt" value="<?php echo $day;?>">
    <input name="yr" type="text" id="yr" value="<?php echo $year;?>">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is this possible? I want to be able to pass java bean data into
I'm integrating LuaInterface into a c# program using LuaInterface. I want to be able
I am trying to separate my worker code from my GUI code into an
I want to be able to separate each item in a listbox with a
I'm using LaTeX and BibTeX for an article, and I want to able to
I want to be able to hide a selector if it contains any data.
I have data that spans multiple months and I want to be able to
I want to be able to display the system timezone as separate plain text
I want to be able to bring up an interactive python terminal from my
So we want to be able to stream a video from a website. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.