How can I output my MySQL data into following structures?
- by sky
Here is the question, how can I output MySQL data into format like :
userAge, userMid are the column name, table name Users.
<script type="text/javascript">
userAge = new Array('21','36','20'),
userMid = new Array('liuple','anhu','jacksen');
</script>
Which I'll be using later with following code :
var html = '
<table class="map-overlay">
<tr>
<td class="user">' +
'<a class="username" href="/' + **userMid[index]** + '" target="_blank"><img alt="" src="' +
getAvatar(signImgList[index], '72x72') +
'"></a><br>
<a class="username" href="/' + **userMid[index]** + '" target="_blank">' +
userNameList[index] +
'</a><br>
<span class="info">' + **userSex[index]** + ' ' + **userAge[index]** + '?<br>
' +
cityList[index] +
'</span>' +
'</td>
<td class="content">' + picString
+ somethings[index] + '<br>
<span class="time">' +
timeList[index] + picTips +
'</span></td>
</tr>
</table>
';
PS: I Just been told that i coulnt use JSON to output that format, so i have no idea now .<
Thanks!