到目前为止,这是我尝试过的
<?php
//Convert the email to variable
$Tnumber2 = "{$_SESSION['Tnumber2']}";
// Connect to the database
$db = mysql_connect("$Sname","$Uname","$Pname") or die("Could not connect to the Database.");
$select = mysql_select_db("$Dname") or die("Could not select the Database.");
$sql="SELECT * FROM $Tname WHERE Tnumber2='".$Tnumber2."'";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
?>
这是我用来从mysql数据库中回显变量的代码
谢谢任何帮助,将不胜感激。
最佳答案
尝试
$sql="SELECT * FROM `$Tname` WHERE Tnumber2='".$Tnumber2."'";
$result=mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
echo $rows['Tnumber2'];
echo $rows['Idate'];
echo $rows['Iaddress'];
}
关于php - 如何从我的mysql数据库中回显变量,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22769439/