formatting mysql_num_rows($sql)
Moderator: General Moderators
-
alcodesign
- Forum Newbie
- Posts: 3
- Joined: Thu Aug 28, 2003 6:55 am
formatting mysql_num_rows($sql)
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.
Code: Select all
$rows = mysql_num_rows($sql);
print "<strong>$rows</strong>";or
Code: Select all
echo '<b>'.mysql_num_rows($sql).'</b>';-
alcodesign
- Forum Newbie
- Posts: 3
- Joined: Thu Aug 28, 2003 6:55 am
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
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?
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?
Try:alcodesign wrote:Code: Select all
echo "<tr><td>{$results['Part']}</td><td>$ + {$results['Price']}.00</td></tr>";
Code: Select all
echo "<tr><td>" . $results['Part'] . "</td><td>$" . $results['Price'] . ".00</td></tr>";