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_Com ment'])) {
$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_pos t)) {
$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_rep ly2)) {
$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;
?>
<?php
if(isset($_GET['Posted_Com
$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_pos
$intPost_ID = $row['intPost_ID'];
$strTime = $row['strTime'];
$strSubject = $row['strSubject'];
$strTitle = $row['strTitle'];
$strComment = $row['strComment'];
$strName = $row['strName'];
}
} elseif(isset($_GET['Reply_
$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_rep
$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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
ASKER
Any clue as to why nothing is showing but the html?
ASKER
Nevermind I got it.
I calling the ID number instead of the name of the ID number.
I calling the ID number instead of the name of the ID number.
ASKER