Jump to content


Photo

Error Help


  • Please log in to reply
4 replies to this topic

#1 Nightseer

Nightseer
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 02 October 2006 - 06:25 PM

Can someone please tell me why this isn't working? I'm really trying, but I'm very new to this, and
I have now been going over the same code for two days with no success:( This is the first thing
I've actually tried to write myself (not modify from open source) and I got it where the rest
is working-you caqn add the message to the database, but I cannotr get it to view how I want it......


<?php
include('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>

";
?>


#2 keithschm

keithschm
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 02 October 2006 - 06:28 PM

echo out $id and make sure it is getting that
NEED HELP

#3 Nightseer

Nightseer
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 02 October 2006 - 06:33 PM

yes, $id echoes as 1 (the test message I'm trying to view.

#4 Nightseer

Nightseer
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 02 October 2006 - 06:38 PM

Figured part of it out-now getting:
Parse error: syntax error, unexpected '>' in /home/virtualp/public_html/view_topic.php on line 21
and can't figure out how to remove it and keep link. code now is:

<?php
include('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>

";
?>


#5 Nightseer

Nightseer
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 02 October 2006 - 06:51 PM

echo out $id and make sure it is getting that


Got it-lol-that wasn't the problem, but using echo on the other variables, I found the problem in the query. Thank you:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users