Jump to content

Why isn't post count displaying?


MySQL_Narb

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.