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 9156583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:48:29+00:00 2026-06-17T12:48:29+00:00

I always had to show a table using the content of a database, but

  • 0

I always had to show a table using the content of a database, but never backwards. One company just published a HTML table with some useful information, however they are not offering a database file, just the table.

It’s a normal table. Just to clarify, something like:

<table>
<tbody>
<tr>
<td>ELEMENT 1</td>
<td>ELEMENT2</td>
<td>ELEMENT 3</td>
<td>ELEMENT 4</td>
</tr>
</tbody>
</table>

What I would like to do is create a database with that date, being ELEMENT 1 the ‘id’, and the rest, information related with that id. I don’t know how to create a bucle to get all the elements from that table, and insert them into the database.

What I’m asking is if there is a way to parse that information, so I can do what I want. I’m not asking the code to insert it into the database or so, just how should I parse that information. 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-17T12:48:31+00:00Added an answer on June 17, 2026 at 12:48 pm

    You need to do this:

     <?php
      //Load the DOM Document
      $doc = new DOMDocument();
      $doc->loadHTMLFile("filename.html");
    
      //Find td elements
      $xpath = new DOMXPath($doc);
      $query = '//your/path/to/table/tbody/tr/td';
      $entries = $xpath->query($query);
    
      $id = $entries->item(0);
      $item1 = $entries->item(1);
      $item2 = $entries->item(2);
      $item3 = $entries->item(3);
    
      //You query here...
     ?>
    

    References:
    DOM

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason I've always had trouble remembering the backwards/forwards compatibility guarantees made by
I need to build one table that show all the sales for one day
Let me start off by saying I had one DLL loading in just fine.
I had used a ListView to show some data (String) retrieved from the database...quite
I'm using Windows Vista and C#.net 3.5, but I had my friend run the
I always had this question: When i dont mind the exact floating number Which
I've always had a weird feeling in my gut about actually deleting rows from
I had some issues with Lucene as it always had a constant score and
I had always wondered why this : var a = [[0, 1]]; a[0] ==
I have modified a working Windows service that had always been starting beforehand. After

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.