Jump to content

Ralphy

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Ralphy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Is this an id problem or is there something I am missing? I am trying to get it to delete a comment...On this 'delete.php' page, $prof is the user sending the delete request, on the page that I'm trying to delete from, $auth is the sender of the comment. $prof = new User($_GET['id']); $query = "UPDATE ProfileComments SET status = 'dead' WHERE id = '".$prof->id."' LIMIT 1"; $request = mysql_query($query,$connection); ?> should I replace a different variable in the query instead of '$prof->id' ? I am not getting any errors, and its not deleting the comment from my page or marking it in the db as dead thanks
  2. I am on my 2nd day of trying to get my delete button to do what I want with PHP. I have a site that is a social network that has user profiles. Users can leave comments on another users profile. I am trying to put a delete link in a designated area that only shows up if you are viewing your own profile and goes away when you are viewing someone elses profile. I am also not wanting to make a delete confirm page. I want the page to reload with the comment selected to delete gone, and be sent to my db marked as dead. This is what I have so far: <?php $query = "SELECT * FROM `ProfileComments` WHERE `ToUserID` = '".$prof->id."' ORDER BY `date` DESC, `time` DESC LIMIT 10"; $request = mysql_query($query,$connection); while($result = mysql_fetch_array($request)) { $poster = new User($result['FromUserID']); echo "<div id='CommentProfile'>"; echo "<div id='CommentPhotoProfile'>"; echo "<a href='http://www.blah.org/Profile.php?id=".$poster->id."'>"; echo "<img src='" . $poster->img('mini') . "' border='0'/>"; echo "</a>"; echo "</div>"; echo "<div id='ProfileCommentBody' class= 'round_10px'>"; echo "<div id='CommentNameProfile'>"; echo "<div class='ProfileCommentTail'> </div>"; echo "<a href='http://www.blah.org/Profile.php?id=".$poster->id."'>"; echo $poster->first_name. " ". $poster->last_name. " <span style='font-weight:normal'>says...</span>"; echo "</a>"; echo "</div>"; echo stripslashes(nl2br($result['commentProfileBody'])); echo "<div id='CommentInfoProfile'>"; echo date('M d, Y',strtotime($result['date'])); echo " at " . date('g:i A',strtotime($result['time'])); if ($poster->id == $prof->id) echo "<a href='http://www.blah.org/DeleteComment.php?id=".$prof->id."'>"; echo " delete"; echo "</a>"; echo "</div>"; echo "</div>"; echo "</div>"; } ?> do I need to make a seperate query underneath the one I already have that is for the composition of the comments? do I need to add on to that query? how do I make the delete button only appear when the user is looking at their own page? how do I make the page reload with the comment gone after I selected it deleted and mark it dead in the db? thank you in advance
×
×
  • 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.