$rowgp="select name,m3,dpsd,phc,jtk from 2sem3 where rno='$rno'";
$resultrow=mysql_query($rowgp);
while($row=mysql_fetch_array($resultrow)){
echo $row['m3'] ." ". $row['oops'];
$one = $row['m3'];
$two = $row['oops']
}
In the above code the variable $one contains a character from a to d (those are the characters present in the field m3). If the char is ‘a’, it should take it as 1; if ‘b’ then 2 (c=3,d=4, and so on). How can I do it without using if or switch statements?
1 Answer