如何更改使用文本框选择的表? [英] How Do I Change The Table Selected Using A Text Box?
本文介绍了如何更改使用文本框选择的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何更改使用文本框选择的表格?我甚至不知道它是否可能,但我想显示不同的表,但能够输入一个名称并让它改变。
<?php
包括' config.php';
mysql_connect(localhost,$ username,$ password);
@mysql_select_db($ database)或 die( 无法选择数据库);
$ query = SELECT * FROM questions;
$ result = mysql_query($ query);
$ num = mysql_numrows($ result);
mysql_close();
echo < center>数据库输出< / center> < br>< br>;
$ i = 0;
while ($ i< $ num){
$ name = mysql_result($ result,$ i, Kiya_text);
$ name = preg_replace( /%你([0-9a-f] {3,4})/ i, \ \1;跨度>,urldecode($名));
echo $名称<峰; br> $报价<峰; br> $生物<峰; br>< HR><峰; br>中跨度>;
$ i ++;
}
?>
我想更改$ query =SELECT * FROM questions;使用html中的文本框
甚至可以。
提前谢谢。
解决方案
用户名,
密码);
@mysql_select_db(
数据库)或 die( 无法选择数据库);
How do i change the table selected using a text box? I dont even know if it its possible but i want to display different tables but be able to type a name and have it change.
<?php
include 'config.php';
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM questions";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<center>Database Output</center><br><br>";
$i=0;
while ($i < $num) {
$name=mysql_result($result,$i,"Kiya_text");
$name = preg_replace("/%u([0-9a-f]{3,4})/i","\\1;",urldecode($name));
echo "$name<br>$quote<br>$bio<br><hr><br>";
$i++;
}
?>
I want to change $query="SELECT * FROM questions"; using a textbox in html
is it even possible.
Thank you in advance.
解决方案
username,
password); @mysql_select_db(
database) or die( "Unable to select database");
这篇关于如何更改使用文本框选择的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文