I would like to show results from one column into four columns using PHP on Wordpress using the insert_php plugin but cannot get any results. I would simply like the results to just show in four columns. I've been trying all sorts of suggestions but nothing seems to work.
Here is the latest:
[insert_php]
$servername = "localhost";
$username = "login";
$password = "pw";
$database = "dbname";
// Create connection
$conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
$result = mysqli_query($conn,"SELECT mine FROM mines ORDER BY mine");
$data = array();
while ($row = mysqli_fetch_array($result)) $data[] = $row;
for ($i = 0; $i < count($data) / 3; $i++){
echo '<table><tr>';
for ($j = 0; $j < 3; $j++){
echo '<td>' . $data[ $i + $j * 3] . '</td>';
}
echo '</tr><tr>'
}
echo '</tr></table>';
[/insert_php]