我正在尝试使用选取框来显示作业表中的所有数据,但有些我怎么也无法显示任何内容,尽管它成功连接到数据库。所以如何使用选框显示数据? / p>
<html>
<body>
<div class="box" STYLE="position:absolute; TOP:110px; LEFT:1100px;height: 470px;width : 200px;padding:10px;" >
<!-- STYLE="position:absolute; TOP:170px; LEFT:980px;height: 349px;width :360px;" -->
<u><font size="3" color="white">- Jobs may inters you :</font></u>
<br>
<marquee direction="up" scrollamount="2">
<p id="boxContent">
<script>
<?php
$conn = new Mysqli("localhost", "root", "", "ISNet");
if($conn->connect_error){
die("Connection failed:".$conn->connect_error);
}
$sql = "SELECT * FROM jobs";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<br> position - ". $row["position"]. "<br> company- ". $row["company"].
" <br> address -" . $row["Address"] ."<br> description - " . $row["description"] . " <br> mail -" . $row["mail"] .
"<br>";
echo "----------------------------------";
}
} else {
echo "0 results";
}
?>
</script></p>
</marquee>
</div>
</body>
</html>
答案 0 :(得分:1)
这就是你在选框开头做的事情:
var mainObject = {};
mainObject.childObject = {};
/* CHILD OBJECT
*/
(function() {
function childObject(){
this.property = 'childObject';
this.childMethod = function(){
console.log( 'child obj method' );
};
}
return childObject;
})().apply(mainObject.childObject);
/* MAIN OBJECT
*/
(function() {
function mainObject(){
this.property = 'mainObject';
console.log( 'main obj method' );
this.childObject.childMethod();
}
return mainObject;
})().apply(mainObject);
console.log( mainObject );
console.log( mainObject.childObject );
您打开一个脚本标记,这样您回显的所有内容都会在脚本标记内部结束,并被浏览器解释为javascript。因此,您可能会在控制台和源代码中看到很多错误。
只需删除开始和结束脚本标签,您将拥有一个非常酷的复古选框: - )