Page 1 of 1

formatting mysql_num_rows($sql)

Posted: Thu Aug 28, 2003 6:55 am
by alcodesign
i am trying to return the number of rows found in a search using mysql_num_rows($sql) and it works just fine; however, I am trying to format the text such as making is bold using <b> </b> but i cannot seem to be able to do it. any advice is greatly appreciated.

Posted: Thu Aug 28, 2003 6:58 am
by JayBird

Code: Select all

$rows = mysql_num_rows($sql);

print "<strong>$rows</strong>";

Posted: Thu Aug 28, 2003 8:43 am
by JAM
or

Code: Select all

echo '<b>'.mysql_num_rows($sql).'</b>';

Posted: Thu Aug 28, 2003 3:31 pm
by alcodesign
thank you for the help. i was able to get it to work. my only other question is how to format a price column my code is as follows

Code: Select all

echo "<tr><td>{$results['Part']}</td><td>$ + {$results['Price']}.00</td></tr>";


the price is displayed 10.00 at the moment with no dollar sign. if i use one it thinks the whole thing is a string. what can i do?

Posted: Thu Aug 28, 2003 3:50 pm
by Crashin
alcodesign wrote:

Code: Select all

echo "<tr><td>{$results['Part']}</td><td>$ + {$results['Price']}.00</td></tr>";
Try:

Code: Select all

echo "<tr><td>" . $results['Part'] . "</td><td>$" . $results['Price'] . ".00</td></tr>";