gpt4 book ai didi

php - 如何删除/隐藏页面最顶部的文本

转载 作者:行者123 更新时间:2023-11-29 14:09:47 26 4
gpt4 key购买 nike

问题

我想知道如何在连接或搜索数据库时不显示屏幕顶部的文本。下面是我正在谈论的内容的屏幕截图。

Screenshot of webpage

有没有可能完全不出现?下面是连接到数据库的代码,以及下面表单的代码。

代码

连接数据库的代码:

<?php       
// Connecting, selecting database
$dbconn = pg_connect("host=***** port=*****
dbname=***** user=***** password=*****")
or die('Could not connect: ' . pg_last_error());

//collect
if(isset($_POST['search'])) {
$searchq = $_POST['search'];
// $searchq = preg_replace("#[^0-9a-z]#i"."".$searchq);

// Performing SQL query
$query = "SELECT vegan FROM enumbers WHERE code LIKE '%$searchq%'";
$ret = pg_query($dbconn, $query);
if(!$ret){
echo pg_last_error($dbconn);
exit;
}
$output = '';
while($row = pg_fetch_assoc($ret)){
$code = $row['code'];
print_r($row);
$name = $row['name'];
$type = $row['type'];
$vegan = $row['vegan'];

$output .= '<div> '.vegan.' ';
}
}
echo "Operation done successfully\n";
pg_close($dbconn);

?>

表单代码:

<div id="tablebox">
<!-- Search bar -->
<p>Is It Vegan?</p>
<form name="form1" method="post" action="searchEnumbers.php">
<input name="search" type="text" size="30" maxlength="5" />
<input name="submit" type="submit" value="Search" />
</form>

<?php
print("$output");
?>
</div>


</div>

最佳答案

只需从您的代码中删除这两行

print_r($row);

.....

echo "Operation done successfully\n";

关于php - 如何删除/隐藏页面最顶部的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43570240/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com