You have to execute the SQL insert for each row. So just move the operation into the
foreach
loop:
foreach ($tds as $sNodeDetail)
{
$row[] = trim($sNodeDetail->textContent);
$query = "INSERT INTO riser (symbol, vwap, last, bid, ask, volume, markchg, markpct, shares, marketcap, ttmsqz) VALUES ('$row[0]', '$row[1]', '$row[2]', '$row[3]', '$row[4]', '$row[5]', '$row[6]', '$row[7]', '$row[8]', '$row[9]', '$row[10]', '$row[11]')";
if ($conn->query($query) !== TRUE)
{
}
if ($stmt = $conn->prepare("INSERT INTO riser (symbol, vwap, last, bid, ask, volume, markchg, markpct, shares, marketcap, ttmsqz) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"))
{
$stmt->bind_param("ssssssssssss", $row[0], $row[1], $row[2], $row[3], $row[4], $row[5], $row[6], $row[7], $row[8], $row[9], $row[10], $row[11]);
if ($stmt->execute() == FALSE)
{
}
$stmt->close();
}
}