Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
how can I get all of the tables from http://www.imq21.com/market/summary this website? should I using DOM HTML?
Literally, you cannot get all the tables easily.
However, the table of that web site is not a flash. thus you can GET the entire raw HTML of that site, and applying Regular expression to parse the item one by one, and create your own class to store the output, and add the fetched data to the table your wanted.
Note:
it is not an API, thus you need to visit another link for another table and apply the same technique (Fetch HTML, regular expression, manipulate the data and store in the table) for all tables that you needed.
it maybe illegal or not regular to fetch data from other web site like that :D ... and if it is owned by you, you can simply write an API for your program to fetch the data directly (faster, and relatively lesser amount of work)
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Please forgive me if this has been asked and answered before, but I couldn't find it in the search.
As stated in the title, I have a form built in HTML. I need the user inputted data to be displayed in an HTML table. I know the easiest way to accomplish this is probably to do so using SQL to store and then retrieve the data and PHP to output it in the table itself. For the life of me I cannot get this to actually work. Google is absolutely my friend but literally nothing I've tried actually works. Examples would be wonderful and I seriously appreciate the help! Thanks!
This link could help you: https://stackoverflow.com/a/15251402/4149985
Basically, you need a web server, either locally or via a hosting provider with access to a database.
Your database needs to have a table, which contains records.
You need to use PHP to connect to the database, retrieve the records and then output them as a HTML table.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am trying to think about how I would go about creating a link to something based on a data in another table on another website.
I have the following table on the other website:
https://i.imgur.com/Hlemt1y.jpg
so basically columns: Order #, Status, customer P-O
What I am trying to do is create a url based on "customer PO" that links to the Order #. So it would find the customer PO, then check the value on the same row of Order #, and then once I have that value I can create the URL using that order #.
I've never done anything that takes a value from another website so I guess that is what I am after?
If the other web page doesn't have an API that you can use to retrieve that data in a more usable format, you will have to use a technique known as scraping. you would likely use curl or wget to fetch the web page and then parse the resulting html page to pull the data you need out of it. an xml library would be able to assist in parsing, but you may be able to get away with a shortcut by searching the string for a common beginning and ending string.
so for example, if there is only one html table on the page, you can search for
<table>
and the matching
</table>
Then parsing the tr and td tags is a little more manageable than dealing with the entire page. In the end it just depends on what this is being used for and how robust it needs to be.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
EDIT: I solved it. Just need to use "MongoDB\BSON\Regex".
I'm storing books as documents in MongoDB, with the individual pages stored as strings in an array. I'm trying to implement a search page that can take a string and return all documents that contain it. Can this be done directly with a MongoDB query called using PHP (i.e searching for a substring within the string arrays)?
I'm using MongoDB\Driver ( http://php.net/manual/en/book.mongodb.php ) because it was the only option that worked on my machine, and I couldn't find detailed documentation or tutorials for this particular driver. Can anyone help?
Something like
db.table.find({"bookTextField": /.*(the string).*/})
EDIT: Of course, replace table by the table name and bookTextField by the field of the table containing the text
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I will be getting tens of thousands of XML documents that I'll need to query. The queries need to encompass all the XML files, not just querying individual files. For example, I might need:
Return the <name> value from the XML file whose <publish_date> is the most recent
What technologies or approach can I use for this scenario?
Loop through each XML file and execute an XPath? This would be too expensive and not scalable
Consume the XML and insert it into a database that has been modeled to respect the XML's schema? Then just do regular SQL queries to get the data I need?
Use an XML database?
Would XQuery be an option?
This needs to be part of an PHP/MySQL solution.
Take your XML files and insert them into eXist-db. You can insert these easily from PHP by doing either a HTTP POST or PUT against their REST API (depending on your needs). If you insert them into the same collection you can then from PHP do a HTTP GET or POST sending an XQuery that queries all of the documents from the same collection, for example.:
collection("/db/your-collection-of-documents")//name[parent::element()/publish_date gt "2014-006-14"]
If you can be more specific about your XML, I could update this question with the REST URI that you would need to use, and an appropriate XQuery.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I just want anyone to correct me if I'm wrong. Can I create a CMS by making a file where you log in as an admin and then you can write an article and send it to a database table. In another file display all articles from the table with ORDER BY id. To delete you simply make a delete script. Do I have to use any other languages like xml or something? Thanks!
The question: Can I make a simple cms by just using PHP and HTML?
No, you don't need other languages.
PHP and MySQL should be sufficient.
Well, the way the articles are displayed depends of HTML, CSS or JS codes you use.
I'm not quite sure what you're asking exactly. But you could easily write something like that in just PHP and HTML, and use a database to store the information.