Issue
This code shows the output as subject1 subject2 subject3 subject4
but I want to store that values in different variables (like $s1=[1],$s2[2],$s3[3],$s4[4]
) so I and use them in different functions what should I do? can any one help please...
Solution
$query = mysql_query("select `subject` from `markssub1` where `sname`='$user' AND `sid`='$id'");
$subjects = [];
while($row = mysql_fetch_array($query))
{
$subjects[] = $row['subject'];
}
foreach($subjects as $subject){
echo $subject . '\n';
}
Answered By - noahnu
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.