SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict eskuel's Avatar
    Join Date
    Apr 2003
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry variables not appearing

    Ok, i should know what the problem is, but i dont.

    I have a function in another php file...

    Code:
    function gettemplate($input){
    $gettemplate = mysql_query("select * from template WHERE name = '$input'");
    while($r=mysql_fetch_array($gettemplate))
    	{    
    	extract($r);
    	eval ("\$content = \"$content\";");
    	echo $content;
    	}
    }
    when i include that file, and then do this...

    Code:
    gettemplate(details);
    It prints everything it should do, except the variables, which are not there

    Does anyone know what im doing wrong?

    Thanks

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't you mean
    gettemplate('details');
    or
    gettemplate($details); ???

  3. #3
    SitePoint Addict eskuel's Avatar
    Join Date
    Apr 2003
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, as 'details' is a name for the template in the mysql table.

    Ive fixed it now, thanks all


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •