The query is return an empty value on the frist row which means that the supposed value in the first row is in the second row , etc etc . How do i correct this?
$query1 = "SELECT * FROM opentrades"; //You don't need a ; like you do in SQL
$result1 = mysql_query($query1);
echo "<table border = '1px'>"; // start a table tag in the HTML
while($row1 = mysql_fetch_array($result1)){
echo "<tr><td>" . "Selection" . "</td><td>" . "Profit/Loss" . "</td></tr>";
echo "<tr><td>" . $row1['selection']."<td>".$offerpricepl. "</tr>";
if ($row1['selection']=='eur/usd')
{
$bidpricepl=$bid;
$offerpricepl=$bid1;
}
elseif ($row1['selection']=='usd/jpy')
{
$bidpricepl=$bid2;
$offerpricepl=$bid3;
}
elseif ($row1['selection']=='usd/cad')
{
$bidpricepl=$bid4;
$offerpricepl=$bid5;
}
elseif ($row1['selection']=='eur/jpy')
{
$bidpricepl=$bid6;
$offerpricepl=$bid7;
}
elseif ($row1['selection']=='eur/chf')
{
$bidpricepl=$bid8;
$offerpricepl=$bid9;
}
elseif ($row1['selection']=='gbp/usd')
{
$bidpricepl=$bid10;
$offerpricepl=$bid11;
}
elseif ($row1['selection']=='aud/usd')
{
$bidpricepl=$bid12;
$offerpricepl=$bid13;
}
elseif ($row1['selection']=='usd/chf')
{
$bidpricepl=$bid14;
$offerpricepl=$bid15;
}
}
echo "</table><br>";