Home > Backend Development > PHP Tutorial > 为何所有按钮只控制同一行数据?

为何所有按钮只控制同一行数据?

WBOY
Release: 2016-06-13 11:18:25
Original
783 people have browsed it

为啥所有按钮只控制同一行数据???
为啥所有按钮只控制同一行数据?应该怎么解决啊。

<br>nbsp;html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><br><br><br><meta><br><title>Insert title here</title><br><script><br />         function showtd(num) {            <br />             document.getElementById("bg"+num).style.display = "none";<br />             document.getElementById("show"+num).style.display = "block";<br />             document.getElementById("ba"+num);<br />             document.getElementById("gn"+num);<br />         }<br />         function hidetd(num) {<br />             document.getElementById("bg"+num).style.display = 'block';<br />             document.getElementById("show"+num).style.display = 'none';<br />         }<br />		function showtext(){<br />			document.getElementById("a").removeAttribute("readOnly");<br />			document.getElementById("b").removeAttribute("readOnly");<br />			document.getElementById("c").removeAttribute("readOnly");<br />			document.getElementById("d").removeAttribute("readOnly");<br />			document.getElementById("e").removeAttribute("readOnly");<br />			document.getElementById("f").removeAttribute("readOnly");<br />			}<br />		function hidetext(){<br />			document.getElementById("a").readOnly="true";<br />			document.getElementById("b").readOnly="true";<br />			document.getElementById("c").readOnly="true";<br />			document.getElementById("d").readOnly="true";<br />			document.getElementById("e").readOnly="true";<br />			document.getElementById("f").readOnly="true";<br />			}<br /><br />     </script><br><br><br>	
Copy after login


$db = mysql_connect('localhost','root','root');
mysql_select_db('ec',$db);
if (!$db)
  {
  die('Could not connect: ' . mysql_error());
  }
$result = mysql_query("select * from goods");
echo "











";
$n = 0;
while($row = mysql_fetch_array($result))
  {
  echo "";
  echo "";
  echo "";
  echo "";
GoodsID BarCode GoodsName Category Specifications Manufacturers Numbers Instructions Pictures Update Delete
" . $row['id'] . "" . "" . "" . "" . "
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template