저는 PHP를 처음 사용하고 일부 기본 기능을 수행하기 위해 충분히 배우 려합니다. 내 사용자가 자신을 편집 할 수있는 표를 만들 수 있었고 다시 표시 할 수 있지만 질문을 만났습니다. 아래 스크립트를 사용하여 다양한 제품에 대한 기술 수준을 입력 할 수 있습니다. 나는 그들이 "0"또는 공란을 입력하는 각 세포를 강조 할 수 있기를 원했다. 사용자 입력은 0-5 사이에 있습니다 (또는 아직 입력하지 않은 경우 비어 있음).MySQL 쿼리 출력을 기반으로 셀의 배경색을 설정하십시오.
이 모든 작업은 내 로컬 호스트에서 수행되므로 모든 보안 조치가 아직 이루어지지 않았 음을 인정합니다.
나는 많은 게시물을 읽고 나 자신을 알아 내려고 노력했지만 근본적으로 내가 잘못 생각한 것을하고있다.
위의 사항에 대한 도움을 주시면 감사하겠습니다. 나는 코딩을 도와 사람들을 위해 (페이팔을 통해) 맥주를 구입하는 것으로 알려져했습니다 여기에 :)
데이터베이스의 결과를 인쇄 할 기존 코드 : 어쩌면
<?php
//This will connect to the database in order to begin this page
mysql_connect("localhost", "root", "time2start") or die (mysql_error());
//Now we will select the database we need to talk to
mysql_select_db("joomla_dev_15") or die (mysql_error());
$query = "SELECT * FROM enterprise_storage WHERE id=1";
$result = mysql_query($query) or die (mysql_error());
echo "<table border='1'>";
echo "$row";
echo "<tr> <th>Product</th> <th>Wayne Beeg</th> <th>Paul Hamke</th> <th>Steve Jaczyk</th> <th>David Jontow</th> <th>Ed MacDonald</th> <th>Michael Munozcano</th> <th>Ron Shaffer</th> <th>Luke Soares</th> <th>Josh Wenger</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array($result)) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['model'];
echo "</td><td>";
echo $row['beeg'];
echo "</td><td>";
echo $row['hamke'];
echo "</td><td>";
echo $row['jaczyk'];
echo "</td><td>";
echo $row['jontow'];
echo "</td><td>";
echo $row['macdonald'];
echo "</td><td>";
echo $row['munozcano'];
echo "</td><td>";
echo $row['shaffer'];
echo "</td><td>";
echo $row['soares'];
echo "</td><td>";
echo $row['wenger'];
echo "</td></tr>";
}
echo "</table>";
?>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Return to the Home Page" ONCLICK="window.location.href='http://localhost/~user/joomla15/custom/skilldisplay.php'">
</FORM>
이 일 중 하나가 작동하지 않았다. 나는 당신이 여기서 말한 것처럼 붙여 넣었습니다. 저장 후 페이지가로드되지 않습니다. (나는 또한 "회색"을 "빨간색"으로 변경했습니다) – user1267673
무엇이 오류입니까? – Dion
은'background-color'이어야합니까? 'color'는 셀이 아닌 텍스트의 색을 제어합니다. – octern