Jump to content

[SOLVED] Php Error Proberly Simple Problem


winmastergames

Recommended Posts

<?php
// connect to db
// select db
$db_host = "$host";
$db_username = "$username";
$db_password = "$password";
$db_name = "$name";
$sortby = "$defaultsortby";
$conn = mysql_connect($db_host, $db_username, $db_password) or die(mysql_error());
mysql_select_db($db_name, $conn) or die("Error 103: MYSQL CONNECT");

$myquery = mysql_query("select * from $SS1db ORDER BY $sortby $sorttype") or die("Error 103: MYSQL CONNECT");
while($row = mysql_fetch_array($myquery)){
extract($row);
echo"
<tr>
	<td>$datetime</td>
	<td>round(($whtotal/1000), 2);</td>
	<td>$record</td>	
</tr>";
}
?>

Well as you can see it should get the number from the MYSQL database then divide it by 1000 but it has a few problems that should be easy to see I just cant figure out a way to fix this Hope you can figure it out.

well you have math function in the middle of an echo so that wont work

echo "<tr>";
echo "<td>$datetime</td>";
echo "<td>".round(($whtotal/1000), 2)."</td>";
echo "<td>$record</td>";
echo "</tr>";

 

but you didnt actually say what the error was but try the above and see if it works now

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.