从数据库表中获取整行[关闭]

I'm creating this league of legends site and in a database I've got tables with each champion's name, position and spell names. I'm wondering how I can access the entire row for just one specific champion.

The Table is built up like following:

TABLE `champions` (
`Champion_Name` TEXT NULL,
`Champion_Positions` TEXT NULL,
`Spell_Passive` TEXT NULL,
`Spell_1` TEXT NULL,
`Spell_2` TEXT NULL,
`Spell_3` TEXT NULL,
`Spell_Ultimate` TEXT NULL
)

And I chose what champion to fetch with $_get, so how do I make PHP search through the database table and include the entire row that contains the corresponding champion's name?

I have looked online but couldn't find a way that I understood or that I thought would work for me.

Presuming you have an active $_SESSION with a username. Just search through your database via your API.

MySQLI:

$ChampName = $_GET['ChampionName'];
$Query = $Conn->prepare("SELECT * FROM champions WHERE `Champion_Name`=?");
$Query->bind_param('s',$ChampName);
$Query->execute();
$Results = $Query->fetch_array(MYSQLI_ASSOC);

If you want more help apart from this.. You will have to show some code on what you have tried.

You might want to look into mysqli __construct on php.net

and do not use mysql_* functions.

I assume the MySQLI answer will work great but here is a PHP MySQL version if you want to use it; for me this formatting always naturally made more sense so just in-case you are the same way here it is:

<?php
$ChampName = $_GET['ChampionName'];
//all your db conneciton stuff
$query = mysql_query("SELECT * FROM champions Where Champion_name='" . $ChampName . "'");
$data = mysql_fetch_assoc($query);
echo $data['Champion_Name'] . '<br>';
echo $data['Champion_Positions'] . '<br>';
echo $data['Spell_Passive'] . '<br>';
/// etc...
?>