Im trying to Fetch data from same Mysql column with multiple Ids and assign each to a variable.
My table is like this
|id |credit|
+----------+
|1 |10 |
+----------+
|2 |20 |
+----------+
|3 |30 |
+----------+
php code is
$sql = "SELECT credit FROM dailycredits Where id IN ('1','2','3')";
$result = $connect->query($sql);
while ($row = mysql_fetch_array($result)){
$id1= $row[0]["credit"];
$id2= $row[1]["credit"];
$id3= $row[2]["credit"];
}