ok. I have the old db table in html format. I deleted the old db table though. I recreated with some new fields and gotten rid of one field which existed in the the old. I'm concerned over how to insert it in.
PHP Code:
$contents_of_page = file_get_contents('saveddbtable/view_blinks1.php.htm');
preg_match_all("#<th.*>(.+)</th#Ui", $contents_of_page, $thInnerHTML);
$contents_of_page = file_get_contents('saveddbtable/view_blinks1.php.htm');
$tdInnerHTML = str_replace("></td>", ">\"\"</td>", $contents_of_page);//to fill the blank tds otherwise it doesn't show
preg_match_all("#<td.*>(.+)</td#Ui", $tdInnerHTML, $tdInnerHTML);
$ths=0;
for($tds=0; $tds<count($tdInnerHTML[1]); $tds++){
if($ths<count($thInnerHTML[1])){
$thInnerHTML[1][$ths] = array();
}
echo $thInnerHTML[1][$ths]." = ".$tdInnerHTML[1][$tds]."<br />\n";
$thInnerHTML[1][$ths][] = $tdInnerHTML[1][$tds];
if($ths==count($thInnerHTML[1])-1){
$ths=0;
}else{
$ths++;
}
}
Is it possible (as I'm trying) to make a sub array by taking the array of fields from the <th> tags and store up the <td> arrays of data in each field?