Hi i wanted to loop the options list of the select tag inside that echo statement from my database. This file out puts the content to a javascript code. and this output is also javascript. any one help me how can i loop that options in select tag from the database. when i tried to use a for loop it gives an error. the javascript doesnt work.
require_once("connections.php");
if(!$_POST['img']) die("There is no such product!");
$img=mysql_real_escape_string(end(explode('/',$_POST['img'])));
$q_result=mysql_query("SELECT * FROM tbl_items WHERE item_photo='".$img."'");
$row=mysql_fetch_assoc($q_result);
$q_rows = mysql_num_rows($q_result);
echo '{status:1,id:'.$row['itid'].',price:'.$row['item_price'].',txt:\'\
\
<table width="100%" id="table_'.$row['itid'].'">\
<tr>\
<td width="20%">'.$row['item_title'].'</td>\
<td width="10%"><select name="'.$row['itid'].'_cnt" id="'.$row['itid'].'_cnt" onchange="change('.$row['itid'].');">\
<option value="1">1</option>\
</select>\
\</td>\
<td width="15%"><select name="'.$row['itid'].'_cnt" id="'.$row['itid'].'_cnt" onchange="change('.$row['itid'].');">\
<option value="1">Daily</option>\
<option value="2">Weekly</option>\
<option value="3">Monthly</option>\
<option value="4">1 Year</option>\
<option value="5">2 Years</option>\
<option value="6">3 Years</option>\
</select>\
\
</td>\
<td width="15%"><a href="#" onclick="remove('.$row['itid'].');return false;" class="remove">Remove</a></td>\
</tr>\
</table>\'}';