jpr35
New Member
Posts: 4
|
Post by jpr35 on Nov 12, 2012 12:08:22 GMT -5
I've changed, uploaded and reuploaded and checked permissions like a million times and i've been sitting here for over 2 hours trying to get this to work. For some reason, on the paradox server, when my user clicks the topic to go to nothing will appear in my forum. Basically I have it set that when they click the link, the link appends CatID=[somenumber] in the url. Then on my topics page I have it using $_GET[CatID] to retrieve the name value pair and work with it in my code. On my local host everything works fine and I do get this error,
Notice: Use of undefined constant CatID - assumed 'CatID' in C:\xampp\htdocs\hw8\topics.php on line 36
I just figured that the paradox system would also understand what I meant and it would work. However, I have no idea how to make this project work without appending name/value pairs to the url and using the $_GET[] method.
So Im not really sure where to go from here. Any help/suggestions would be appreciated.
|
|
|
Post by Bob P on Nov 12, 2012 13:37:47 GMT -5
Hmmmmm, Check your quote marks - it looks like PHP can't find your array reference so it is turning to looking for constants.
Try: $_GET['CatID'];
Bob
|
|
jpr35
New Member
Posts: 4
|
Post by jpr35 on Nov 12, 2012 15:16:33 GMT -5
Still doesn't work. Whatever it is, I can't get any of my stuff to display. The same issue is happening with my topics and replies. I'm assuming it has to be something with the way I'm retrieving it or appending it because everything else looks fine. Essentially this is what the link looks like. www.sis.pitt.edu/~ug57/1059/hw8/topics.php?CatID=2And this is the code I'm using to run the query and display the result sets in a table. This should all be ok though because it works just fine on my localhost. if($loggedIn) { echo'<center><h1>Welcome to the forum!<h1></center><br /><br />'; $query = "SELECT Topics.ID, Topics.Name, NumReplies, Users.Username FROM topics, users WHERE Users.UserID = Topics.FKAuthorID and Topics.FKCatID = " . $_GET['CatID']; $result = mysql_query($query); $row = mysql_fetch_row($result); echo'<table border = "1" bordercolor = "black" align = "center" width = "700"><tr class="forumBars"><td>Forum Topic</td><td>Replies</td> <td>Author</td></tr>'; do { echo "<tr>"; echo "<td><a href =\"replies.php?TopID=" . $row[0] . "\">" . $row[1] . "</a></td>"; echo "<td>" . $row[2] . "</td>"; echo "<td>" . $row[3] . "</td>"; echo "</tr>"; $row = mysql_fetch_row($result); }while($row); echo '<tr><td class="forumBars" colspan = "3">Logged In As: <font color = "red">' . $formUsername . '</font> - <a href = "categories.php" class = "whiteLink">To Categories</a> </td><tr></table>'; }
|
|
jpr35
New Member
Posts: 4
|
Post by jpr35 on Nov 12, 2012 15:34:34 GMT -5
RESOLVED!
Apparently phpmyadmin doesn't care about the case of your first character in a table name. So originally my tables were named with cap letters like Topics, Categories, Replies, but when I transferred over to isam, phpmyadmin used topics, categories, replies. This was of course screwing up the queries and they weren't executing properly. So I just went through my code and adjusted all the queries accordingly and now it seems to work correctly! ;D
|
|
|
Post by Bob P on Nov 12, 2012 15:45:34 GMT -5
I'm assuming your local machine is windows which is not case sensitive. Paradox is on Unix which is very, very case sensitive. Bob
|
|