How do I make a variable a negative number??
Ive got $row[EntryValue] and $row[EntryRW].
What I need to do is, if EntryRW equals '1', I need to make the Figure for EntryValue a negative number.
Does that make sense??
Ive come up with this but it doesnt seem to work, unless I'm just putting it in the wrong place,
if ($row[EntryRW]==1)
{
$row[EntryValue] = "-". $row[EntryValue];
}
I'll, post a copy of my script aswell just incase im putting it in the wrong place
$SQL1 = "SELECT * FROM Entry WHERE UserID = '$userID' AND EntryAdjustment IS NULL AND (EntrySelect=4 AND (EntryBalanceSheet=1))";
$result1 = mysql_query($SQL1) or die(mysql_error());
$num_rows = mysql_num_rows($result1);
if ($num_rows > 0 )
{
$NoOfEntries=true;
while($row = mysql_fetch_array($result1))
{
$rows[] = $row;
if ($row[EntryRW]==0)
{
$row[EntryValue] = "-". $row[EntryValue];
}
}
}
Any suggestions, Ideas, or general help is appreciated
Thanks