Is there a shortcut for showing and selecting mysql without using the mysql_fetch_array to every variable?
<?
$result = mysql_query("SELECT * FROM tblpp WHERE section='1' game='1'");
while($row = mysql_fetch_array($result))
{
$s1g1 = $row['score'];
}
$s1g2;$s1g3;$s1g4;$s1g5;
?>
Should I keep adding the $result to every statement just to show it or is there a shortcut?
If you want to append the result to a variable you can do so using period concatenation:
If you wish to save the data for use later, you can store it in an array:
Also, please stop using
mysql_functions. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi – this article will help you decide which.