winmastergames Posted June 13, 2008 Share Posted June 13, 2008 <?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. Link to comment https://forums.phpfreaks.com/topic/110029-solved-php-error-proberly-simple-problem/ Share on other sites More sharing options...
Orio Posted June 13, 2008 Share Posted June 13, 2008 Try: <?php echo" <tr> <td>{$datetime}</td> <td>".(round(($whtotal/1000), 2))."</td> <td>{$record}</td> </tr>"; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/110029-solved-php-error-proberly-simple-problem/#findComment-564603 Share on other sites More sharing options...
jesushax Posted June 13, 2008 Share Posted June 13, 2008 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 Link to comment https://forums.phpfreaks.com/topic/110029-solved-php-error-proberly-simple-problem/#findComment-564605 Share on other sites More sharing options...
winmastergames Posted June 13, 2008 Author Share Posted June 13, 2008 Thanks Alot Link to comment https://forums.phpfreaks.com/topic/110029-solved-php-error-proberly-simple-problem/#findComment-564609 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.