Next the html code wich output the table:
Code: Select all
$i=1;
While($row=mysql_fetch_object($result)) {
$des1=mysql_fetch_object($result2);
$orden= mysql_fetch_object($result3);
print "<td>
<IMG SRC="header.php?PicNum=$row->PicNum" border="0" high="200" width ="100">
</td>
<td>
<p align='center'>$des1->des1</p>
</td>
<td><p align='center'>$orden->orden</p>
</td>
<td>
<p align= 'center'><input type='text' name='newO".$i++."'size='1' value=0 maxlength='15'></p>
</td>";
$counter += 1;
print"</tr></table><input type='submit' name='orden' value='gogo'></form>";
}Now see line 17, when I press the submit button I reload this file (file.php)
Code: Select all
while($row=mysql_fetch_object($result)){
mysql_query("UPDATE imagen SET orden = $newO1 WHERE PicNum = PicNum LIMIT 1") or die ("wrong ".mysql_error());//here is the problem
}this is the table "imagen":
Code: Select all
PicNum int(11) auto_increment Primary
imagen blob BINARY
des1 varchar(25)
des2 varchar(255)
seccion varchar(10)
precio int(11)
orden int(11) //orden=orderAlvaro
ps: sorry about my english