Jump to content

how save price with product name in database mysql..


tazeha

Recommended Posts

I using PHP Simple HTML DOM Parser .

Now I write the mini script .

This script find the products online shopping with price.

<?phpinclude_once('simple_html_dom.php');// Create DOM from URLheader("Refresh: 300;");$html = file_get_html('http://wpu.ir/v3128');$articles = array();// Find all article blocksforeach($html->find('div#content') as $article) {    $item['title']     = $article->find('h1', 0)->plaintext;    $item['intro']    = $article->find('h3', 0)->plaintext;    $item['details'] = $article->find('span.finalprice', 0)->plaintext;    $articles[] = $item;}echo $title="<b>نام محصول:</b>". $item['title'] . "</br>  ";echo  $dec="<b>توضیحات:</b> ". $item['intro'] . "</br> "; echo $pr="<b>قیمت:</b> ". $item['details'] . " </br> ";  //to fetch all images from a webpage$images = array();foreach($html->find('img') as $img) { $images[] = $img->src;}echo " $images[29]";?> 

I have save price in table database mysql.. how can?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...