|
|
Please consider registering: registration is fast, easy and free! Benefits of registration:
- Free advertising for your website: Every post in our forums goes towards a "credit" of ads, which are displayed on most pages of our forums. Each post gives you 400 ad impressions. To submit your ad, edit your profile.
- Discount at TemplateMonster: All our members enjoy a 10% discount at TemplateMonster.com!
|
- Private Messages: Exchange private messages with other members of the forums.
- Message Tracking/Subscription: phpBB enables you to subscribe to threads which interest you, and will then email you when a reply is posted. phpBB also remembers which posts registered users have read during a session, which means you can keep track of which posts you have already looked at.
|
|
| Author |
Message |
Kdawg
Senior WebHelper


Joined: 21 Apr 2003
Posts: 163
|
Posted:
Sun Apr 27, 2003 7:54 pm (10 years ago) |
  |
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());
?>
|
|
|
|
    |
 |
Daniel
Team Member


Joined: 06 Jan 2002
Posts: 2192
Location: London, UK
|
Posted:
Sun Apr 27, 2003 7:56 pm (10 years ago) |
  |
Shouldn't {$player} be $player? |
________________________________
 |
|
     |
 |
Iyonix
WebHelper


Joined: 12 Nov 2002
Posts: 88
Location: Yarm, England
|
Posted:
Sun Apr 27, 2003 8:08 pm (10 years ago) |
  |
| 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 |
|
    |
 |
Kdawg
Senior WebHelper


Joined: 21 Apr 2003
Posts: 163
|
Posted:
Mon Apr 28, 2003 1:41 am (10 years ago) |
  |
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());
?>
|
|
|
|
    |
 |
Daniel
Team Member


Joined: 06 Jan 2002
Posts: 2192
Location: London, UK
|
Posted:
Mon Apr 28, 2003 5:59 am (10 years ago) |
  |
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. |
________________________________
 |
|
     |
 |
|
|
|
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.058079 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
|