Forum Moderators: coopster
<form name="Getting_Spells2" method="post" action="free-app3.php">
<?php
//Including the connection information
include "config.php";
//connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass) or die("Could not connect to MySQL");
//select the database
mysql_select_db($database) or die ("Could not select database");
//Put the result into an array
$result = mysql_query ("SELECT DISTINCT spell_name FROM spells WHERE spell_class = '".$class."' AND spec = '".$spec."' AND spell_level BETWEEN '".$level_low."' AND '".$level."'") or die('Error getting array form spells table '.mysql_error ());
while($row = mysql_fetch_array($result))
{
$spell_id=$row["spell_id"];
$spell_name=$row["spell_name"];
$class=$row["spell_class"];
$level=$row["spell_level"];
$knowledge=$row["spell_knowledge"];
$mindmg=$row["min_dmg"];
$maxdmg=$row["max_dmg"];
$mindot=$row["min_dot"];
$maxdot=$row["max_dot"];
$dot_ticks=$row["dot_ticks"];
$cast_time=$row["cast_time"];
$duration=$row["duration"];
$recovery=$row["recovery"];
$recast=$row["recast"];
$triggers=$row["triggers"];
$avg_dmg=$row["avg_dmg"];
$instant_time=$row["instant_time"];
$total_cast_time=$row["total_cast_time"];
$instant_dps=$row["instant_dps"];
$dps=$row["dps"];
$spec=$row["spec"];
echo "<input type=\"checkbox\" name=\"spell_name2[]\" value=\"".$spell_name."\" >";
echo $spell_name." ". $class ."<BR>";
//Including the connection information
include "config.php";
//connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass) or die("Could not connect to MySQL");
//select the database
mysql_select_db($database) or die ("Could not select database");
//Get the spell knowledge for the row
$query2 = mysql_query ("SELECT knowledge FROM spell_knowledge ORDER By knowledge_id ASC") or die(mysql_error());
//Put the result into an array
$result2 = mysql_fetch_array($query2);
if ($result2) {
$rowno = 0;
echo("<select name=\"knowledge2[]\" size=\"1\" id=\"knowledge2[]\"><BR><BR>");
while ($row = mysql_fetch_assoc($query2)) {
$rowno++;
foreach($row as $_k=>$_v) {
echo("<option value=\"" .$_v. "\">" .$_v. "");
}
}
echo("</select>");
}
else {
# Print error
echo "<b>Query2 failed: Knowledge</b><br>".mysql_error();
}
echo "<br />";
}
?>
<input type="submit" name="Submit" value="Submit">
</form><br>