Error Logs are clean, I have added die statements to a javascript alert to locate any problem with the database and fail to see any.
I tried what WeedPacket said to do, which by the way would shorten my script ultimately so I love the idea thank you, but still same problem. Script just freezes up after Speed II is applied to the character.
<?php
$blessingStats = explode(', ', $char['blessing']);
if (in_array('Might', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Might'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Might')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalstr += $charstr * $equation;
}
if (in_array('Might II', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Might II'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Might II')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalstr += $charstr * $equation;
}
if (in_array('Might III', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Might III'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Might III')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalstr += $charstr * $equation;
}
if (in_array('Might IV', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Might IV'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Might IV')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalstr += $charstr * $equation;
}
if (in_array('Might V', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Might V'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Might V')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalstr += $charstr * $equation;
}
$stradd = '<font color="#0099FF">+ ' . $totalstr . '</font>';
if (in_array('Speed', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Speed'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Speed')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totaldex += $chardex * $equation;
}
if (in_array('Speed II', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Speed II'")or die("alert('Mysql Error!');");
$level = mysql_fetch_assoc($result)or die("alert('Mysql Error!');");
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Speed II')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totaldex += $chardex * $equation;
}
if (in_array('Speed III', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Speed III'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Speed III')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totaldex += $chardex * $equation;
}
if (in_array('Speed IV', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Speed IV'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Speed IV')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totaldex += $chardex * $equation;
}
if (in_array('Speed V', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Speed V'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Speed V')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totaldex += $chardex * $equation;
}
$dexadd = '<font color="#0099FF">+ ' . $totaldex . '</font>';
if (in_array('Constitution', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Constitution'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Constitution')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalend += $charend * $equation;
}
if (in_array('Constitution II', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Constitution II'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Constitution II')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalend += $charend * $equation;
}
if (in_array('Constitution III', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Constitution III'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Constitution III')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalend += $charend * $equation;
}
if (in_array('Constitution IV', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Constitution IV'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Constitution IV')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalend += $charend * $equation;
}
if (in_array('Constitution V', $blessingStats))
{
$result = mysql_query("SELECT level FROM affinity WHERE name='Constitution V'");
$level = mysql_fetch_assoc($result);
$foo = 0;
for($i = 0, $count = count($blessingStats); $i < $count; $i++)
{
if($blessingStats[$i] == 'Constitution V')
{
$foo += $level['level'];
}
}
$equation = $foo / 10;
$totalend += $charend * $equation;
}
$endadd = '<font color="#0099FF">+ ' . $totalend . '</font>';
?>