echo'';
echo'';
echo'';
missing $ in the values.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Try this.
echo'<input name="tradeaid" type="hidden" id="tradeaid" value="'.$tradeaid.'">';
echo'<input name="mtitle" type="hidden" id="mtitle" value="'.<$mtitle.'">';
echo'<input name="nmain" type="hidden" id="nmain" value="'.nmain.'">';
echo '<tr><td width="90% align=left"><a onclick="submit();">'. $stitle. '</s></td></tr>';
I think its a bad practice to use <?=$varname instead of <?php echo $varname; ?>
Edit: And please use code tags while posting your code. It really helps.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
In news.php, request id's value and fetch the data from the table for that particular id.
For example, news.php?id=4
//news.php
//db connection
$id = mysql_real_escape_string($_GET['id']);
$query = "select * from newstable where id = '$id'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
print_r($row); //display the news for id = 4
?>
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Change the table name (and column name) !
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Yes. It displays everything it fetches for that particular id. You can limit your output by choosing what to print. As you can see, $row is an array. $row['intnewsID'] will have 7, $row['newsTit'] will have "Ecuador offers to buy out oil companies" and so on.. Check this out.
http://nl3.php.net/mysql_fetch_array
This is how you can print only newsTit value.
//news.php
//db connection
$id = mysql_real_escape_string($_GET['id']);
$query = "select * from newstable where id = '$id'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
print $row['newsTit'];
?>
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356