Hello, I am learning PHP and I have 0 experience with programming. Please forgive me if this is a stupid question. So I have the following code:
<?php
// set variables from form input
$upperLimit = $_POST['limit'];
$lowerLimit = 1;
// keep printing squares until lower limit = upper limit
do {
echo '<tr><td>'.($lowerLimit * $lowerLimit).'</td></tr>';
$lowerLimit++;
}
while($lowerLimit <= $upperLimit);
// print end marker
echo '<br />END';
?>
The ouput is a table, and each number is showing up on a different row.
How can I get the table to have 2 columns, and then have the numbers populate the 2 columns and however many number of rows.
I do not want the same numbers on two different columns. I want the result of $lowerLimit * $lowerLimit to fill in the table with no repeated number.
I am not sure if I need to use an if/then statement, or the for() loop.
If someone could explain how to achieve this seemingly simple task, I would be much obliged!