Russia Posted August 26, 2009 Share Posted August 26, 2009 Hello, I have made this row counter and would like some help, I would like to align the output to the right side of the screen and infront of the numbers add 'Number of Members:' Here is the script: $result = mysql_query("select count(*) as rowcount from notes"); $row = mysql_fetch_array($result); echo $row['rowcount']; I think the echo needs to be written differently. Link to comment https://forums.phpfreaks.com/topic/171981-row-counter/ Share on other sites More sharing options...
Asheeown Posted August 26, 2009 Share Posted August 26, 2009 <?php $result = mysql_query("select count(*) as rowcount from notes"); $Count = mysql_result($result, 0); echo "Number of Members: $Count"; ?> Link to comment https://forums.phpfreaks.com/topic/171981-row-counter/#findComment-906845 Share on other sites More sharing options...
Russia Posted August 26, 2009 Author Share Posted August 26, 2009 How would I align it to the right? Link to comment https://forums.phpfreaks.com/topic/171981-row-counter/#findComment-906847 Share on other sites More sharing options...
Asheeown Posted August 26, 2009 Share Posted August 26, 2009 Didn't see you set rowcount, thought you needed a new way to get the count: echo "<span style=\"text-align:right\">" . $row['rowcount'] . "</span>"; Link to comment https://forums.phpfreaks.com/topic/171981-row-counter/#findComment-906850 Share on other sites More sharing options...
Russia Posted August 26, 2009 Author Share Posted August 26, 2009 It now seems to not be showing up at all: <?php $result = mysql_query("select count(*) as rowcount from notes"); $Count = mysql_result($result, 0); echo "<span style=\"text-align:right\">" . $row['rowcount'] . "</span>"; ?> Link to comment https://forums.phpfreaks.com/topic/171981-row-counter/#findComment-906852 Share on other sites More sharing options...
Asheeown Posted August 26, 2009 Share Posted August 26, 2009 <?php $result = mysql_query("select count(*) as rowcount from notes"); $Count = mysql_result($result, 0); echo "<span style=\"text-align:right\">$Count</span>"; ?> Used your variable before, didn't think you stuck with my way of doing it. Link to comment https://forums.phpfreaks.com/topic/171981-row-counter/#findComment-906871 Share on other sites More sharing options...
Russia Posted August 26, 2009 Author Share Posted August 26, 2009 Nope nothing. Link to comment https://forums.phpfreaks.com/topic/171981-row-counter/#findComment-906881 Share on other sites More sharing options...
Asheeown Posted August 26, 2009 Share Posted August 26, 2009 Use a div then, I knew span would cause problems echo "<div style=\"text-align:right\">$Count</div>"; Link to comment https://forums.phpfreaks.com/topic/171981-row-counter/#findComment-906885 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.