Jump to content

claudej2007

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.assistprogramming.com

Profile Information

  • Gender
    Not Telling

claudej2007's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Your wellcome;) I'll soon(1-2days) lunch a board on my site where ppl can ask questions and I'll personally do my best to help them. So you guys can try to get helped there too
  2. Ok now I see what you problem is! You can just echo the "games" because you need them in a variable for sending to the template file. I see two work arounds: let's see the first. Mod the get_games() function to look like this: function get_games(){ $query = mysql_query("SELECT gameID,gameTitle,gameDescription FROM games"); $numgames = mysql_num_rows($query); ob_start(); for ($i = 0; $i <= $numgames; $i++){ while($fetch=mysql_fetch_array($query)){ $gameID=$fetch["gameID"]; $gameTitle=$fetch["gameTitle"]; $gameDescription=$fetch["gameDescription"]; $temps = array( 'GAMEID' => $gameID, 'GAMETITLE' => $gameTitle, 'GAMEDESC' => $gameDescription ); $file="themes/default/game_list.tpl"; $setgames = set_template($file, $temps); $game[$i] = $setgames; echo $game[$i]; } } $ret=ob_get_contents(); ob_end_clean(); return $ret; } I've used here the php output buffering functions. You can read a this complete tutorial about <a href="http://php.assistprogramming.com/php-buffer-output-put-contents-in-a-variable.html">PHP output buffering functions</a>. That should be it. now it would work as you want. let me know if you have troubles making this work and I'll help you. I won't present the other workaround just yet since I dont think that is necessary Cheers Claude
  3. Hello Shouldn't call your function when you include the fucntions.php file. Something is wrong there. what template engine do you use? maybe that is causing an issue. Do you have other stuff in function.php?I could try to look closer if you post some more details Thanks Read another interesting programming tips and tricks on my site: <a href="http://www.assistprogramming.com">Programming tips and tricks</a>
  4. Hi there, You might replace action="<?php echo $_SERVER['localhost']; ?>" with action="<? echo $_SERVER['PHP_SELF']; ?>" Shouldn't get that error this way. Anyways, here is a complete tutorial of how to post a form to a database using php+mysql - http://php.assistprogramming.com/how-to-post-a-form-to-a-database-using-php.html
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.