yeah sorry i should have done this from the very start.
<?php
include('simple_html_dom.php');
// Create DOM from URL or file
$html = file_get_html('http://oneofmysites.com/stuffineedthisisjustafakeforpostinghere.html');
foreach($html->find('table.resultsTable') as $article) {
$item['image'] = $article->find('img[class=thumbnail]',0)->src;
$item['title'] = $article->find('strong',0)->plaintext;
$item['details'] = $article->find('div[style=margin-top:5px]',0)->plaintext;
$item['price'] = $article->find('td[id=price]',0)->plaintext;
$item['timestamp'] = $article->find('td[width=13%]',0)->plaintext;
$item['link'] = $article->find('a',0)->href;
$articles[] = $item;
}
//just to check below
//print_r($articles);
//the login include file is infact correct
include("./ws3js/loginstuffexample.php");
$connection = mysql_connect($host,$user,$password)
or die ("Sorry the server is currently updating, Check back in a few minutes");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");
//below I really dont know what "mysql_real_escape_string" actually means lol ( tutorial)
$success = mysql_query("INSERT INTO `db123` (`image`, `title`, `details`, `price`, `timestamp`,`link`) VALUES ('".mysql_real_escape_string($data[0])."', '".mysql_real_escape_string($data[2])."', '".mysql_real_escape_string($data[3])."', '".mysql_real_escape_string($data[4])."', '".mysql_real_escape_string($data[5])."', '".mysql_real_escape_string($data[6])."')");
if($success) {
echo 'data inserted';
} else {
echo 'Something went wrong: ' . mysql_error();
}
mysql_close($connection);
?>
the above currently connects, and only adds a row of blank.. if I run this again, another row of blank. But the results are in fact 20 rows.. so i know im doin the mysql insert line wrong somehow.