Hoke Posted December 5, 2007 Share Posted December 5, 2007 ok I have a java applet for a puzzle, it uses PARAM's I'd like the param's to to be pulled from mysql based on a predefined id number e.g. in mysql id 1 has other fields populated, score, cols, rows,imgpath I connect to mysql via a config.php script but I'm not sure of the syntax to put on the page to correctly place all of the variables, I'll give you an example <? include("config.php"); $nm = stripslashes($nm); $puzzle = select("*","puzzles","puzzle_id='$id' and puzz_name='$nm'"); if($puzzle['puzzle_id'] != ""){ $puzzlename=$puzzle['puzz_name']; $pts=$puzzle['points']; $puzz=true; $rows=$puzzle['rows']; $cols=$puzzle['cols']; $imgpath=$puzzle['imgpath']; $key=$puzzle['key']; $besttime=$puzzle['bestTime']; $bonustime=$puzzle['bonusTime]; $bonuspoints=$puzzle['bonuspoints']; ?> <html> <head> <title> The Hello World Applet </title> </head> <body> <p>Here is the output of my applet:</p> <applet code="SlidePuzzle.class" width="500" height="500"> <param name="id" value="$id"> <param name="rows" value="$rows"> <param name="cols" value="$cols"> <param name="imgPath" value="$imgpath"> <param name="key" value="$key"> <param name="pts" value="$pts"> <param name="bestTime" value="$besttime"> <param name="bonusTime" value="$bonustime"> <param name="bonusPts" value="$bonuspoints"> <param name="width" value="500"> <param name="height" value="500"> </applet> </body> </html> my error is Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/gametest.php on line 16 Parse error: syntax error, unexpected '<' in /home/gametest.php on line 33 I feel it is something that should be simple but as a beginner, these are the things that leave me scratching my head for days, it should get new entries for he params based on the current id number PHP Ver 5.2.4 Quote Link to comment Share on other sites More sharing options...
Stooney Posted December 5, 2007 Share Posted December 5, 2007 http://www.php-mysql-tutorial.com/php-mysql-select.php Quote Link to comment Share on other sites More sharing options...
revraz Posted December 5, 2007 Share Posted December 5, 2007 You should address those errors too $bonustime=$puzzle['bonusTime]; is missing the end ' You also can't use PHP Variables like this in HTML <param name="id" value="$id"> You need to wrap the $id in PHP. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.