Link to home
Start Free TrialLog in
Avatar of pingeyeg
pingeyeg

asked on

If statement no longer works after changing ID field to auto-increment

I don't get this, but ever since I changed the ID fields to auto-increment which is where they should have originally been the page doesn't work anymore.  This is my if statement now, which worked before I changed that setting for the IDs.

<?php
if(isset($_GET['Posted_Comment'])) {

$sql_post = mysql_query("SELECT Posts.intPost_ID, Posts.strTime, Posts.strSubject, Posts.strTitle, Posts.strComment, Posts.strName FROM Posts WHERE intPost_ID = '" . $_GET['intPost_ID'] . "' ") or die(mysql_error());
            
            while($row = mysql_fetch_array($sql_post)) {
            
                  $intPost_ID = $row['intPost_ID'];
                  $strTime = $row['strTime'];
                  $strSubject = $row['strSubject'];
                  $strTitle = $row['strTitle'];
                  $strComment = $row['strComment'];
                  $strName = $row['strName'];
                  
            }

      } elseif(isset($_GET['Reply_Comment'])) {
      
$sql_reply2 = mysql_query("SELECT Replies.intReply_ID, Replies.strTime, Replies.strReply, Replies.strReply_Name, Posts.strSubject, Posts.strTitle, Posts.strComment FROM Posts, Replies WHERE Replies.intReply_ID = '" . $_GET['intReply_ID'] . "' ") or die(mysql_error());
      
            while($row = mysql_fetch_array($sql_reply2)) {
                  
                  $intReply_ID = $row['intReply_ID'];
                  $strTime = $row['strTime'];
                  $strReply = $row['strReply'];
                  $strReply_Name = $row['strReply_Name'];
                  $strSubject = $row['strSubject'];
                  $strTitle = $row['strTitle'];
                  
            }
      }
echo title . $strTitle;
?>
ASKER CERTIFIED SOLUTION
Avatar of Oscurochu
Oscurochu
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pingeyeg
pingeyeg

ASKER

Nope that didn't work.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Everything appears to be in order.  I tried deleting the ones I inserted and then inserted another one, but still doesn't work.  When I click on reply to that comment the next page doesn't have anything from the db there other than the text from html.
Any clue as to why nothing is showing but the html?
Nevermind I got it.

I calling the ID number instead of the name of the ID number.