php - shortcut for showing and selecting mysql without using the mysql_fetch_array to every variable -
is there shortcut showing , selecting mysql without using mysql_fetch_array every variable?
<? $result = mysql_query("select * tblpp section='1' game='1'"); while($row = mysql_fetch_array($result)) { $s1g1 = $row['score']; } $s1g2;$s1g3;$s1g4;$s1g5; ?> should maintain adding $result every statement show or there shortcut?
if want append result variable can using period concatenation:
$s1g1 .= $row['score']; if wish save info utilize later, can store in array:
$array[] = $row[score]; also, please stop using mysql_ functions. no longer maintained and officially deprecated. see red box? larn prepared statements instead, , utilize pdo or mysqli - this article help decide which.
php mysql
No comments:
Post a Comment