Status Function [Comment Feature]

Fait

Seasoned Veteran
Joined
Oct 15, 2010
Messages
4,407
Reaction score
561
FP$
2,054
I know that i should be learning myself but som help on certain things an also help someone learn so i can study on the code.

Now ive made a status system and posts that a user has made tommorow i will add the links directly to there page.

can someone please help with adding a feature where a user can comment on a post created.

Thanks
 
It's very very simple, it's basically the same process as the status with extra added code.

Get a piece of paper and write our logically how it will work and then do it.
 
I worked that out last night 🙂

But how would the tables be set out?

-- 27 May 2012, 23:08 --

Hey im trying to make so users can edit there own pages or delete there own status posts, how do i do this??

heres the updated code its looking at all the tables, need it to look at one, I learn buy studying codes aswill... and if the users on the pageowner tables

Code:
<?php
session_start();
$username = $_SESSION['username'];
/* 
 DELETE.PHP
 Deletes a specific entry from the 'players' table
*/

$get = $_GET['id'];
 // connect to the database
 mysql_connect ("localhost","root","");
 mysql_select_db ("pph") or die ("Could Not Select Database");

 
 
 // check if the 'id' variable is set in URL, and check that it is valid
 if (isset($_GET['id']) && is_numeric($_GET['id']))
 {
 // get id value
 $id = $_GET['id'];
 
 // select the entry
  mysql_query ("SELECT * FROM pages WHERE pid='$get'") or die ("Query Erro on line 21");
    $query = mysql_query("SELECT * FROM pages WHERE pageowner='$username'") or die ("jhgfrw");

   $row = mysql_fetch_array($query);

if ($row['pageowner'] == $username)
print ("kj");
  
 ?>

 <?php

 $username = $_SESSION['username'];
 // Lets echo the tables (We need to make a new style soon 
 
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("pph", $con);

$result = mysql_query("SELECT * FROM pages");
$result = mysql_query ("SELECT * FROM pages WHERE pid ='$get'") or die ("Query Error");

while($row = mysql_fetch_array($result))
  {
 
  print ("Username<br>"); echo $row['pageowner'] . "<td> " .  $row['pageinfo'];
   
   $query = mysql_query("SELECT * FROM pages WHERE pageowner='$username'") or die ("jhgfrw");
   $query = mysql_query("SELECT * FROM pages WHERE pageowner='$$get'") or die ("jhgfrw");

  
  echo "<br /><br><br>";


}
   
mysql_close($con);
}
die ("");
?>
 
Back
Top Bottom