I don't have PHP, but now there's only PHP space,
Want a function, very simple one,
Two columns (A & B) in the data table
Implementation: I enter a value in the text box, in the database query a column of the value of the B column corresponding to the value and return to the page.
The amount ... Can a great God help write a more complete sentence? That includes the database Connection statements section.
Reply to discussion (solution)
error_reporting (0);
$conn =mysql_connect ("localhost", "root", "root");//fill in the database connection information
mysql_select_db ("test");//fill in the database name
$valA = $_post["ValA"];
if ($valA! = "") {
$sql = "SELECT * FROM Test where a=". $valA;
$result =mysql_query ($sql);
while ($arr =mysql_fetch_array ($result))
{
echo $arr ["B"]. "
";
}
}else{
?>
}
?>
? is outsourcing, since you do not want to?
You?? function doesn't??, Bai? You're done.
error_reporting (0);
$conn =mysql_connect ("localhost", "root", "root");//fill in the database connection information
mysql_select_db ("test");//fill in the database name
$valA = $_post["ValA"];
if ($valA! = "") {
$sql = "SELECT * FROM Test where a=". $valA;
$result =mysql_query ($sql);
while ($arr =mysql_fetch_array ($result))
{
echo $arr ["B"]. "
";
}
}else{
?>
}
?>
Thank you, thank you very much
? is outsourcing, since you do not want to?
Gaga, you use. NET will, helpless know logic is not become PHP, to ask for the next PHP big god ...
error_reporting (0);
$conn =mysql_connect ("localhost", "root", "root");//fill in the database connection information
mysql_select_db ("test");//fill in the database name
$valA = $_post["ValA"];
if ($valA! = "") {
$sql = "SELECT * FROM Test where a=". $valA;
$result =mysql_query ($sql);
while ($arr =mysql_fetch_array ($result))
{
echo $arr ["B"]. "
";
}
}else{
?>
}
?>
echo $arr ["B"], B replace with the column name of my column?
Well, yes, a is replaced with your conditional field name, B is replaced with the field name you want to get the result