名为' Marks'的列中的值在我的数据库中存储为[45,56]。我想将其值提取为45和56。我尝试过如下。但没有单独获得价值。
$result =mysql_query("SELECT * FROM school where StudentID='$ss'") or die(mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
$Fromtable_CurrMARK= $row['marks']; //getting as [45,56]
$CurrMark = json_decode( $Fromtable_CurrMARK);
$mark1 = $CurrMark[0];
$mark2 = $CurrMark[1];
}