Monday, 15 June 2015

php - converting concat'ed number result to corosponding text form db -



php - converting concat'ed number result to corosponding text form db -

in php code when type

while($row = mysql_fetch_array($result, mysql_num )) { echo "<table border=1 ; cellpadding:5px; style='border-collapse: collapse; border: 1px #ccc; width: 100%; height:200px'>"; { echo "<tr> <td width= 35%> " values' </td> <td width= 65%> '.$row[1].' </td> </tr>'; } echo "</table>"; } mysql_free_result($result);

it displays

151,152,154,155

those numbers concat single line, "151,152,154,155" table called validation , table field id. there field in validation table called text corresponds number.

table example

**mysql table: validation** id text -------------- 151 right 152 plugin 153 154 type 155 apple

for illustration id=151 row has text, "correct" , id=152 row has text, "plugin" , on...

i want display this....

correct, plugin, type, apple

instead of numbers.

please suggest me how replace numbers codes.

i tried of adding

'.$row[1].'

to array , fetching using loop cannot success.

php mysql

No comments:

Post a Comment