PDA

View Full Version : Get something from MySQL- PHP/MYSQL problem-


klausre
06-12-03, 05:16 AM
Hi!
I’m now customizing a script to my needs, and most of it is easy to do, but I have problems whit some things that I like to have some guides or help whit.

I'm trying to make a link to my forum board whit a gif-image if I have entered a link to a related discussion. The script takes and displays the article if there is an article in the db.

I have marked the original script in red and my customizing inn blue.

It does not give any error, but the link is not being displayed. Does anyone now what I have made wrong.
if(is_numeric($articleId))
{
$aResult = mysql_query("select apTitle, apContent from tbl_ArticlePages where apArticleId = '$articleId' order by pk_apId asc limit " . ($page-1) . ", 1");

if($aRow = mysql_fetch_array($aResult))
{
// Display the details of this article
DisplayArticleHeader($articleId, false, BIG_BLACK_TITLE);

echo "<hr width='96%'>";

// Show the ratings bar
ShowRatingBar($articleId);

// Update the numer of times that this article has been shown
if($page == 1)
UpdateViews($articleId);

echo "<div align='right'><br>";

$forumlink = mysql_query("select aForumLink from tbl_Articles where pk_aId = '$ArticleId'");
if($flink = mysql_fetch_array($forumlink))
{
if($flink["aForumLink"] != ""){
echo "<a href='{$flink["aForumLink"]}'><img border='0' src='images/diskuterarticle.gif'></a>";
}
}

echo "<a href=\"javascript:OpenWin('printpage.php?articleId=$artic leId', 'prnArt', '650', '550', 'yes')\"><img border='0' src='images/printarticle.gif'></a>&nbsp;&nbsp;</div>";
echo "<table width='96%' align='center' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo " <td>";
echo " <span class='BodyHeading4'>{$aRow["apTitle"]}</span>";
echo " <br><br><span class='Text1'>{$aRow["apContent"]}</span>";
echo " </td>";
echo "</tr>";
echo "</table>";
echo "<hr width='96%'>";

Stefan
06-12-03, 06:12 AM
in your query you seem to refer to the id of the article as $ArticleId where just a few lines up they were using $articleId ... so it might be a matter of case sensitive-ness ?

klausre
06-12-03, 01:18 PM
Thank you!!That was the problem :D

Stefan
06-12-03, 01:49 PM
hehe. no problem. glad it's working now :)