Quote:
Originally Posted by Marco van Herwaarden
I am not interested in what you expect the value to be, but in the real value.  You can use a vardump or echo to list the value.
If you are using query_first then you should not have te message that it is a resource id.
|
well, i finally got a working piece of code!

(curtesy of PHPbuilder.com). perhaps when u see my code, u will see how simple my question was in the first place. probably my fault, making it appear complicated.
Code:
//jfk
$forum_name="$pagetitle";
$query=("SELECT forumid FROM " . TABLE_PREFIX . "forum WHERE title='$forum_name'");
$result=mysql_query($query);
if( mysql_num_rows ($result)) //if it has a match from the database/table
{
$row=mysql_fetch_assoc($result); //lets get that matched row's id, and create a link
$forum_link="<a href=\"/forums/forumdisplay.php?f=".$row["forumid"]."\">$forum_name Forum</a>";
}
//end jfk
i now use the $var "$forum_link" whereever i want the link to appear. this is my hacked version of the code, perhaps u could suggest some tidying that would be more consistent with vbull?