I am currently fetching data and I got that working. I pull up the "name" from the table with this in a drop menu: mysql_connect('localhost:3306', 'root', ''); mysql_select_db('champion'); $sql = "SELECT name FROM champion"; $result = mysql_query($sql); echo "<select name='champion'>"; while ($row = mysql_fetch_array($result)) { echo "<option value='" . $row['name'] ."'>" . $row['name'] ."</option>"; } echo "</select>"; The main thing I'm trying to do here is create two drop down menus with the name of champions (got one), it can be the same name in both fields but I want to display a 3rd field of text that shows the relationship between both names that are displayed. I think I can handle the mysql tables but I'm not how this would work in php. Any help will be greatly appreciated!
I don't know ajax I'm just starting php. I can use the same table but I guess what I'm trying to do it a operator I believe? like x+y=c? example: When Annie and drake are chosen a box will display varchar field of text from database.
<?php $mysql_hostname = "localhost:3306"; $mysql_user = "root"; $mysql_password = ""; $mysql_database = "champion"; $prefix = ""; $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("No connection"); mysql_select_db($mysql_database, $bd) or die("No connection"); mysql_set_charset('utf8',$bd); $sql = "SELECT * FROM name ORDER BY id DESC"; $num_rows = mysql_num_rows(mysql_query($sql)); $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $name=$row['name']; ?><li><?php echo $name ; } ?> PHP: use this code