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

  • SEARCH
  • Home
  • 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 8773169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:13:34+00:00 2026-06-13T18:13:34+00:00

I am pulling out a date value in the format 2012-12-28 from a database

  • 0

I am pulling out a date value in the format 2012-12-28 from a database and now I need to create a html li element using the date value.

The li elements are in the following form which have an id and calls two javascript functions.

<li id="date2012-12-28" onClick="showUser('2012-12-28'); getID(this.id);">2012-12-28</li>

In this example the date “2012-12-28” is a variable value from the database.

How can I construct a php query to generate these links dynamically?

For example

echo '<li id="' . $value . + "onClick="showUser('" . $value . "');" ....

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-06-13T18:13:35+00:00Added an answer on June 13, 2026 at 6:13 pm

    With the result set you would iterate over it with a foreach, so something like:

    <?php foreach($result as $row){?>
    <li id="date<?=$row['date'];?>" onClick="showUser('<?=$row['date'];?>'); getID(this.id);"><?=$row['date'];?></li>
    <?php } ?>
    

    or

    <?php 
    foreach($result as $row){
        echo '<li id="date'.$row['date'].'" onClick="showUser(\''.$row['date'].'\'); getID(this.id);">'.$row['date'].'</li>';
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pulling date values out of mysql and displaying them in locally used format.
I am pulling a date out of a database and it is a varchar.
I have a date value (e.g. 2011-04-11 07:45:00.000) which I am pulling from my
I'm pulling a row from a database and there is a date field (y-m-d).
I am pulling records out of my mysql database using php and want to
I have data in Excel files that I am pulling out using the MS
Using JavaScript I am pulling names out of webpage and stringing them together somehow
I am pulling my hair out on this one... I am using the ASIHTTPRequest
I am trying to list out all records from a database that have not
I am pulling out a number of notes associated with a time from my

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.