Forum Moderators: coopster
This is my best effort so far, but just returns a blank page...
<?php
$columnselect = $_POST["selection"];
$rowreturn = "SELECT * FROM menu WHERE linktext = '$columnselect'";
$rowdata = mysql_query($rowreturn) or die('Query failed: ' . mysql_error());
// This is the row data bit
echo "<table>";
echo "<tr>";
while ($columnvalues = mysql_fetch_row($rowdata)); {
$columns = $columnvalues['*'];
echo "<td>$columns</td>";
}
echo "</tr>";
echo "</table>";
?>
in the part $columns = $columnvalues['*']; I'm not sure how to specify ALL data, that is why I used the '*' in $columnvalues.
print_r() displays information about a variable in a way that's readable by humans. If given a string, integer or float, the value itself will be printed. If given an array, values will be presented in a format that shows keys and elements. Similar notation is used for objects.
I use it for checking arrays to make sure what I want to be happening is actually happening.
there is a link on the page for echo [php.net] to a short dicussion about the difference.
echo is a language construct and print is a function so there are different benefits for each.