| Code: |
| <?php
$dbserver = 'localhost'; $dbname = 'WWWWWWWWW'; $dbuser = 'WWWWWWWWW'; $dbpasswd = 'WWWWWWW'; $db = mysql_connect($dbserver, $dbuser, $dbpasswd) or die('Could not connect to DB server!'); mysql_select_db($dbname) or die("Could not connect to database: " . mysql_error()); $PLAYER = $_GET['PLAYERID']; $rplayer = mysql_query("SELECT * FROM Players WHERE PLAYERID = '$PLAYER'") or die(mysql_error()); while($row = mysql_fetch_array($rplayer)) { $teamid = $row['TEAMID']; $teamname = $row['TEAM']; $name = $row['FIRSTNAME']; $lname = $row['LASTNAME']; $position = $row['POSITION']; $age = $row['AGE']; $college = $row['COLLEGE']; $experience = $row['EXPERIENCE']; $height = $row['DISPLAYHEI']; $weight = $row['WEIGHT']; $agency = $row['AGENCY']; $level = $row['LEVEL']; $happiness = $row['ATTITUDE']; $consistency = $row['CONSISTENC']; $greed = $row['GREED']; $loyalty = $row['LOYALTY']; $playforwinner = $row['PLAYFORWIN']; $playtime = $row['PLAYINGTIM']; $motivation = $row['MOTIVATION']; $personality = $row['PERSONALIT']; $durability = $row['DURABILITY']; $workethic = $row['WORKETHIC']; $popularity = $row['POPULARITY']; $fgj = $row['FGJ']; $ft = $row['FT']; $fgd = $row['FGD']; $fgthree = $row['FG3']; $scoring = $row['SCORING']; $passing = $row['PASSING']; $handling = $row['HANDLING']; $oreb = $row['OREB']; $dreb = $row['DREB']; $defense = $row['DEFENDER']; $discipline = $row['DISCIPLINE']; $drawfoul = $row['DRAWFOUL']; $iq = $row['BBALLIQ']; $steal = $row['STEAL']; $block = $row['BLOCK']; $contracta = $row['CY1']; $contractb = $row['CY2']; $contractc = $row['CY3']; $contractd = $row['CY4']; $contracte = $row['CY5']; $contractf = $row['CY6']; $bird = $row['BIRDYEARS']; $endurance = $row['ENDURANCE']; }; //Team Photo $rteam = mysql_query("SELECT * FROM teamlogos WHERE TEAMID = '$teamid'") or die(mysql_error()); while($row = mysql_fetch_array($rteam)) { $abbr = $row['ABBR']; $color = $row['COLOR']; }; //Player Names $namel = strtolower($name); $lnamel = strtolower($lname); $photo = $namel ._. $lnamel; //Currency Convert $currencya = number_format($contracta,0); $currencyb = number_format($contractb,0); $currencyc = number_format($contractc,0); $currencyd = number_format($contractd,0); $currencye = number_format($contracte,0); $currencyf = number_format($contractf,0); if(file_exists("WWWW.html")) { $template = file_get_contents("WWWW.html"); $template = str_replace("{teamname}", $teamname, $template); $template = str_replace("{name}", $name, $template); $template = str_replace("{lname}", $lname, $template); $template = str_replace("{position}", $position, $template); $template = str_replace("{age}", $age, $template); $template = str_replace("{college}", $college, $template); $template = str_replace("{experience}", $experience, $template); $template = str_replace("{height}", $height, $template); $template = str_replace("{weight}", $weight, $template); $template = str_replace("{happiness}", $happiness, $template); $template = str_replace("{consistency}", $consistency, $template); $template = str_replace("{greed}", $greed, $template); $template = str_replace("{loyalty}", $loyalty, $template); $template = str_replace("{playforwinner}", $playforwinner, $template); $template = str_replace("{playtime}", $playtime, $template); $template = str_replace("{personality}", $personality, $template); $template = str_replace("{durability}", $durability, $template); $template = str_replace("{workethic}", $workethic, $template); $template = str_replace("{popularity}", $popularity, $template); $template = str_replace("{motivation}", $motivation, $template); $template = str_replace("{fgj}", $fgj, $template); $template = str_replace("{fgthree}", ${fgthree}, $template); $template = str_replace("{ft}", $ft, $template); $template = str_replace("{fgd}", $fgd, $template); $template = str_replace("{scoring}", $scoring, $template); $template = str_replace("{passing}", $passing, $template); $template = str_replace("{handling}", $handling, $template); $template = str_replace("{oreb}", $oreb, $template); $template = str_replace("{dreb}", $dreb, $template); $template = str_replace("{defense}", $defense, $template); $template = str_replace("{discipline}", $discipline, $template); $template = str_replace("{drawfoul}", $drawfoul, $template); $template = str_replace("{iq}", $iq, $template); $template = str_replace("{steal}", $steal, $template); $template = str_replace("{block}", $block, $template); $template = str_replace("{contracta}", $currencya, $template); $template = str_replace("{contractb}", $currencyb, $template); $template = str_replace("{contractc}", $currencyc, $template); $template = str_replace("{contractd}", $currencyd, $template); $template = str_replace("{contracte}", $currencye, $template); $template = str_replace("{contractf}", $currencyf, $template); $template = str_replace("{bird}", $bird, $template); $template = str_replace("{endurance}", $endurance, $template); $template = str_replace("{ppg}", $ppg, $template); $template = str_replace("{abbr}", $abbr, $template); $template = str_replace("{color}", $color, $template); $template = str_replace("{photo}", $photo, $template); echo $template; }; ?> |
How can I insert Database Fields from this part of the code below .. if the Fields are from the other Tables not from Table Players
Because I need to get the Stats data from the other Table and show it on the pages I used another page for the Template or the Skinning.. Thats why the codes above is the declaration and query of of the Database..
| Code: |
| {
$teamid = $row['TEAMID']; $teamname = $row['TEAM']; $name = $row['FIRSTNAME']; $lname = $row['LASTNAME']; $position = $row['POSITION']; $age = $row['AGE']; $college = $row['COLLEGE']; $experience = $row['EXPERIENCE']; $height = $row['DISPLAYHEI']; $weight = $row['WEIGHT']; $agency = $row['AGENCY']; $level = $row['LEVEL']; $happiness = $row['ATTITUDE']; $consistency = $row['CONSISTENC']; $greed = $row['GREED']; $loyalty = $row['LOYALTY']; $playforwinner = $row['PLAYFORWIN']; $playtime = $row['PLAYINGTIM']; $motivation = $row['MOTIVATION']; $personality = $row['PERSONALIT']; $durability = $row['DURABILITY']; $workethic = $row['WORKETHIC']; $popularity = $row['POPULARITY']; $fgj = $row['FGJ']; $ft = $row['FT']; $fgd = $row['FGD']; $fgthree = $row['FG3']; $scoring = $row['SCORING']; $passing = $row['PASSING']; $handling = $row['HANDLING']; $oreb = $row['OREB']; $dreb = $row['DREB']; $defense = $row['DEFENDER']; $discipline = $row['DISCIPLINE']; $drawfoul = $row['DRAWFOUL']; $iq = $row['BBALLIQ']; $steal = $row['STEAL']; $block = $row['BLOCK']; $contracta = $row['CY1']; $contractb = $row['CY2']; $contractc = $row['CY3']; $contractd = $row['CY4']; $contracte = $row['CY5']; $contractf = $row['CY6']; $bird = $row['BIRDYEARS']; $endurance = $row['ENDURANCE']; }; |
Thanks hope to hear it from you soon. Thanks!
