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. Quote Link to comment 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"; ?> Quote Link to comment 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? Quote Link to comment 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>"; Quote Link to comment 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>"; ?> Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Russia Posted August 26, 2009 Author Share Posted August 26, 2009 Nope nothing. Quote Link to comment 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>"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.