Nightseer Posted October 2, 2006 Share Posted October 2, 2006 Can someone please tell me why this isn't working? I'm really trying, but I'm very new to this, andI have now been going over the same code for two days with no success:( This is the first thingI've actually tried to write myself (not modify from open source) and I got it where the restis working-you caqn add the message to the database, but I cannotr get it to view how I want it......[code]<?phpinclude('inc/membersonly.php');include('h2.php');// get value of id that sent from address bar $id=$_GET['id'];$sql="SELECT * FROM forum_question WHERE id='$id'";$result=mysql_query($sql);$rows=mysql_fetch_array($result);$author = $row['fid'];$message = $row['detail'];$subject = $row['topic'];$datetime = $row['datetime'];echo "<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"><tr><td bgcolor="#F8F7F1"><strong>$subject</strong></td></tr><tr><td bgcolor="#F8F7F1">$message</td></tr><tr><td bgcolor="#F8F7F1"><strong><b>Author:</b> <a href=account.php?vmid=$author>" . getUsername($author) . "</a></td></tr><tr><td bgcolor="#F8F7F1"><strong>Date/time : </strong>$datetime</td></tr></table></td></tr></table>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/22778-error-help/ Share on other sites More sharing options...
keithschm Posted October 2, 2006 Share Posted October 2, 2006 echo out $id and make sure it is getting that Link to comment https://forums.phpfreaks.com/topic/22778-error-help/#findComment-102548 Share on other sites More sharing options...
Nightseer Posted October 2, 2006 Author Share Posted October 2, 2006 yes, $id echoes as 1 (the test message I'm trying to view. Link to comment https://forums.phpfreaks.com/topic/22778-error-help/#findComment-102552 Share on other sites More sharing options...
Nightseer Posted October 2, 2006 Author Share Posted October 2, 2006 Figured part of it out-now getting:Parse error: syntax error, unexpected '>' in /home/virtualp/public_html/view_topic.php on line 21and can't figure out how to remove it and keep link. code now is:[code]<?phpinclude('inc/membersonly.php');include('h2.php');// get value of id that sent from address bar $id=$_GET['id'];$sql="SELECT * FROM forum_question WHERE id='$id'";$result=mysql_query($sql);$rows=mysql_fetch_array($result);$author = $row['fid'];$message = $row['detail'];$subject = $row['topic'];$datetime = $row['datetime'];echo "<table width=\"400\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#CCCCCC\"><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bordercolor=\"1\" bgcolor=\"#FFFFFF\"><tr><td bgcolor="#F8F7F1"><strong>$subject</strong></td></tr><tr><td bgcolor=\"#F8F7F1\">$message</td></tr><tr><td bgcolor=\"#F8F7F1\"><strong><b>Author:</b> <a href=account.php?vmid=$author>" . getUsername($author) . "</a></td></tr><tr><td bgcolor=\"#F8F7F1\"><strong>Date/time : </strong>$datetime</td></tr></table></td></tr></table>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/22778-error-help/#findComment-102559 Share on other sites More sharing options...
Nightseer Posted October 2, 2006 Author Share Posted October 2, 2006 [quote author=keithschm link=topic=110272.msg445463#msg445463 date=1159813737]echo out $id and make sure it is getting that[/quote]Got it-lol-that wasn't the problem, but using echo on the other variables, I found the problem in the query. Thank you:) Link to comment https://forums.phpfreaks.com/topic/22778-error-help/#findComment-102581 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.