|
Author |
Message |
Kdawg
Senior WebHelper
![Senior WebHelper Senior WebHelper](images/rank_3.gif)
![](images/avatars/gallery/computers/php.gif)
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Sun Apr 27, 2003 7:54 pm (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Can someone please tell me the parse error on line 13
Code: | <?php
$player = $_POST[player]; $game = $_POST[game];
$ab = $_POST[ab];
$sng = $_POST[sng];
$dbl = $_POST[dbl];
$tpl = $_POST[tpl];
$hr = $_POST[hr];
$wlk = $_POST[wlk];
$stk = $_POST[stk];
$hbp = $_POST[hbp];
$scf = $_POST[scf];
mysql_select_db("",mysql_connect("localhost","",""));
$sql = "UPDATE {$player}_Stats SET ab = $ab, sng = $sng, dbl = $dbl, tpl = $tpl, hr = $hr, wlk = $wlk, stk = $stk, hbp = $hbp, scf = $scf WHERE id = $game");
$result = mysql_query($sql)
or die("Invalid query: " . mysql_error());
?>
|
|
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Kdawg Find all posts by Kdawg](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Apr 27, 2003 7:56 pm (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Shouldn't {$player} be $player? |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Iyonix
WebHelper
![WebHelper WebHelper](images/rank_2.gif)
![](images/avatars/gallery/computers/risc_os_cogwheels_small.gif)
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Sun Apr 27, 2003 8:08 pm (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Code: |
$sql = "UPDATE ".$player."_Stats SET ab = $ab, sng = $sng, dbl = $dbl, tpl = $tpl, hr = $hr, wlk = $wlk, stk = $stk, hbp = $hbp, scf = $scf WHERE id = $game");
|
|
________________________________ Iyonix |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Iyonix Find all posts by Iyonix](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Kdawg
Senior WebHelper
![Senior WebHelper Senior WebHelper](images/rank_3.gif)
![](images/avatars/gallery/computers/php.gif)
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Mon Apr 28, 2003 1:41 am (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
I had to edit it a little, but I still get an error on 13.
Code: | <?php
$player = $_POST[player]; $game = $_POST[game];
$ab = $_POST[ab];
$sng = $_POST[sng];
$dbl = $_POST[dbl];
$tpl = $_POST[tpl];
$hr = $_POST[hr];
$wlk = $_POST[wlk];
$stk = $_POST[stk];
$hbp = $_POST[hbp];
$scf = $_POST[scf];
mysql_select_db("",mysql_connect("","",""));
$sql = "UPDATE ("$player."_Stats" SET (ab) = ($ab), (sng) = ($sng), (dbl) = ($dbl), (tpl) = ($tpl), (hr) = ($hr), (wlk) = ($wlk), (stk) = ($stk), (hbp) = ($hbp), (scf) = ($scf) WHERE (id) = ($game)");
$result = mysql_query($sql)
or die("Invalid query: " . mysql_error());
?>
|
|
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Kdawg Find all posts by Kdawg](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Mon Apr 28, 2003 5:59 am (21 years, 1 month ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
What's with all the parentheses?
Try this:
Code: | $sql = "UPDATE ".$player."_Stats SET ab = $ab, sng = $sng, dbl = $dbl, tpl = $tpl, hr = $hr, wlk = $wlk, stk = $stk, hbp = $hbp, scf = $scf WHERE id = $game"; |
That should work now. You had a missing "." and an extra ")" on the end. |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.134979 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
|