I have generated a dynamic table using javascript,
the table wont show all the existing record in my table.
it shows like
1
2
3
4
5
7
8
9
10
11
13
Whats wrong with the code?
here is the code
$query = "SELECT * FROM $table_select ";
$result = mysql_query($query);
$num = mysql_num_rows($result);
$i=0;
while ($i < $num) {
$orderId = mysql_result($result,$i,"order_id");
@setcookie("orderId",$orderId);
$row = mysql_result($result,$i,"product_id");
$linkUrl=mysql_result($result,$i,"link");
$pic=mysql_result($result,$i,"photo");
$unitPR=mysql_result($result,$i,"unit_price");
$QTY=mysql_result($result,$i,"qty");
$totao_unit_price = $unitPR*$QTY;
$expressFEE=mysql_result($result,$i,"express");
$comm=mysql_result($result,$i,"comission");
$customerDESC=mysql_result($result,$i,"customer_st");
if(strpos($linkUrl, 'http://') !== 0) {
$linkUrl = 'http://'.$linkUrl;
}
?>
<script language="javascript">
var x=document.getElementById("myTable");
var row=x.insertRow(-1);
var cell1=row.insertCell(0);
var cell2=row.insertCell(0);
var cell3=row.insertCell(0);
var cell4=row.insertCell(0);
var cell5=row.insertCell(0);
var cell6=row.insertCell(0);
var cell7=row.insertCell(0);
var cell8=row.insertCell(0);
var cell13=row.insertCell(0);
var cell14=row.insertCell(0);
cell1.innerHTML="<?php echo $customerDESC ?>";
cell2.innerHTML="<?php echo $comm ?>";
cell3.innerHTML="<?php echo $expressFEE ?>";
cell4.innerHTML="<?php echo $totao_unit_price ?>";
cell5.innerHTML="<?php echo $QTY ?>";
cell6.innerHTML="<?php echo $unitPR ?>";
cell7.innerHTML="<img src='<?php echo '../'.$pic; ?>' width='50' height='50' align='middle'/>";
cell8.innerHTML="<a href=\"<?php echo $linkUrl ?>\" target='_blank'>Link</a>";
cell13.innerHTML="<?php echo $row ?>";
cell14.innerHTML="<b><input name='edit' type='button' onclick='editRow(this)' value='Изменить' /><input name='del' type='button' onclick='delRow(this)' value='удалить' /> </b>";
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "url", {validateOn:["blur"], hint:"Http://www."});
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "real", {validateOn:["blur"], hint:"0.00"});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "integer", {validateOn:["blur"], hint:"How many ?"});
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "currency", {validateOn:["blur"], hint:"0.00", format:"dot_comma"});
var sprytextarea2 = new Spry.Widget.ValidationTextarea("sprytextarea2", {validateOn:["blur"], maxChars:200, hint:"Descripe what you need to buy.", isRequired:false});
</script>
<?php
$i++;
}
?>

New Topic/Question
Reply


MultiQuote




|