MySQL_Narb Posted October 24, 2009 Share Posted October 24, 2009 Code: <?php require "global_settings.php"; ?> <title><?php echo $sitetitle; ?></title> <font face='arial' size='3'></a> <?php session_start(); ?> <center> <style> a:link { color:#24374C; text-decoration:none; } a:visited { color:#24374C; text-decoration:none; } a:active { outline: none; color:#24374C; text-decoration:none; } body {background-color:#b0c4de} div.box { width:250px; padding:10px; border:3px double #000000; margin:10px; background-color:#74AFF2; } p { border-top-style:dotted; border-right-style:solid; border-bottom-style:dotted; border-left-style:solid; } div.menu-blue { BORDER-RIGHT: #333366 1px solid; BORDER-LEFT: #6699cc 1px solid; BORDER-TOP: #6699cc 1px solid; BORDER-BOTTOM: #333366 1px solid; FONT-WEIGHT: normal; COLOR: #ffffff; BACKGROUND-COLOR: #23559C; TEXT-DECORATION: none; font-stretch : condensed; } .menu-top { BORDER-RIGHT: 1px solid #333366; BORDER-TOP: 1px solid #6699CC; FONT-WEIGHT: normal; BORDER-LEFT: 1px solid #6699CC; COLOR: #FFFFFF; BORDER-BOTTOM: 1px solid #333366; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #23559C; TEXT-DECORATION: none; font-stretch : condensed } </style> <center> <div class='menu-blue'> <div align="center"> <table width="600" cellspacing="1" cellpadding="5" style="background-color:#23559C"> <tr> <td style="background-color:#FFFFFF"> <div align="center"> <table border="0"> </form> </table> <center> <form action="profiles.php?username="<?php echo $name; ?>" method="GET"><br /><br /> Member name:<input type='text' name='name'></form> </center> <?php $name = $_GET['name']; $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); //display data $get = mysql_query("SELECT * FROM users WHERE username='$name'"); while ($row = mysql_fetch_assoc($get)) // get data $signature = $row['signature']; $posts = $row['post_count']; $query = mysql_query("SELECT * FROM users WHERE username='$name'"); $numrows = mysql_num_rows($query); if (!$name) { echo "Please enter in a username"; } else { if ($numrows!=1) { echo "<div class='box'><b><span style='color:red'>This user doesn't exists!</span></b></div>"; } else { if ($name =="$owner") $name = " <img src='crown_gold.gif'></img><b> $owner</b>"; echo "<div class='box'>This is a profile of "; echo $name; echo "<br /><br />Signature:<b> "; echo $signature; echo "$posts"; } } ?> Link to comment https://forums.phpfreaks.com/topic/178882-why-isnt-post-count-displaying/ Share on other sites More sharing options...
Alex Posted October 25, 2009 Share Posted October 25, 2009 Is the signature showing? If so then your query is fine and in that case I'm make sure that the row holding the post count is actually called 'post_count'. Link to comment https://forums.phpfreaks.com/topic/178882-why-isnt-post-count-displaying/#findComment-943737 Share on other sites More sharing options...
MySQL_Narb Posted October 25, 2009 Author Share Posted October 25, 2009 Is the signature showing? If so then your query is fine and in that case I'm make sure that the row holding the post count is actually called 'post_count'. Yes inside the database it's post_count, so why isn't it displaying? Link to comment https://forums.phpfreaks.com/topic/178882-why-isnt-post-count-displaying/#findComment-943738 Share on other sites More sharing options...
MySQL_Narb Posted October 25, 2009 Author Share Posted October 25, 2009 Bump Link to comment https://forums.phpfreaks.com/topic/178882-why-isnt-post-count-displaying/#findComment-943778 Share on other sites More sharing options...
MySQL_Narb Posted October 25, 2009 Author Share Posted October 25, 2009 Bump?............ Link to comment https://forums.phpfreaks.com/topic/178882-why-isnt-post-count-displaying/#findComment-943791 Share on other sites More sharing options...
mikesta707 Posted October 25, 2009 Share Posted October 25, 2009 if everything but post_count is showing up, than it would seem that either the column isn't called post_count (which you confirmed it did) or the column doesn't have any data stored at that place. check your database, and make sure it looks at is should Link to comment https://forums.phpfreaks.com/topic/178882-why-isnt-post-count-displaying/#findComment-943792 Share on other sites More sharing options...
Coreye Posted October 25, 2009 Share Posted October 25, 2009 Try: $get = mysql_query("SELECT * FROM `users` WHERE `username` = '" . $name . "'"); while ($row = mysql_fetch_assoc($get)) { /* get data */ $signature = $row['signature']; $posts = $row['post_count']; } Link to comment https://forums.phpfreaks.com/topic/178882-why-isnt-post-count-displaying/#findComment-943804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.