dark22horse Posted September 11, 2007 Share Posted September 11, 2007 Hi guys, Just trying a simple update form, but its not working. Parse error: syntax error, unexpected T_VARIABLE, expecting ']' in C:\Program Files\xampp\htdocs\Poker\uploader3.php on line 26 <html> <head> <title>Uploaded</title> </head> <body style="margin:0;"> <? require_once("mysql_config.php"); $id = $_POST['id']; $name=$_POST['name']; $nickname=$_POST['nickname']; $first=$_POST['first']; $second=$_POST['second']; $buy_in=$_POST['buy_in']; $won=$_POST['won']; $profit_loss=$_POST["profit_loss"]; $played=$_POST['played']; $win_ratio=$_POST['win_ratio']; $top_2_ratio=$_POST['top_2_ratio"]; $average_return=$_POST["average_return"]; **problem here ** $sql_string = "UPDATE player SET name='$name', nickname='$nickname', first='$first', second='$second', buy_in='$buy_in', won='$won', profit_loss='$profit_loss', played='$played', win_ratio='$win_ratio', top_2_ratio='$top_2_ratio', average_return='$average_return'"." WHERE id='$id'"; mysql_query($sql_string) OR die(mysql_error()); $ok = mysql_query($sql_string); if($ok){ echo "<h2>all is good, upload another</h2>"; } else { echo "<h2>check the string".$sql_string."</h2>"; } ?> <a href="update.php"> Click here to update another player</a> </BODY> </html> Quote Link to comment https://forums.phpfreaks.com/topic/68918-solved-problem-updating/ Share on other sites More sharing options...
corbin Posted September 11, 2007 Share Posted September 11, 2007 $top_2_ratio=$_POST['top_2_ratio"]; You can choose between " and ' (I personally prefer '), but I don't know if you can mix them like that x.x. Quote Link to comment https://forums.phpfreaks.com/topic/68918-solved-problem-updating/#findComment-346413 Share on other sites More sharing options...
BlueSkyIS Posted September 11, 2007 Share Posted September 11, 2007 no, you can't mix them like that. Quote Link to comment https://forums.phpfreaks.com/topic/68918-solved-problem-updating/#findComment-346415 Share on other sites More sharing options...
dark22horse Posted September 11, 2007 Author Share Posted September 11, 2007 K cheers, that cleared that problem up. However when I update the name and nickname get wiped, even though something is there when I try to update them. Quote Link to comment https://forums.phpfreaks.com/topic/68918-solved-problem-updating/#findComment-346419 Share on other sites More sharing options...
dark22horse Posted September 11, 2007 Author Share Posted September 11, 2007 Cheers guys, can u believe I have been looking at that for 1.5 hours. changing little bits, but didnt notice it! My other problem has been resolved! Quote Link to comment https://forums.phpfreaks.com/topic/68918-solved-problem-updating/#findComment-346423 Share on other sites More sharing options...
BlueSkyIS Posted September 11, 2007 Share Posted September 11, 2007 you mean something is in the form fields? check the names of your form fields, print_r($_POST) to see if they are coming over. Quote Link to comment https://forums.phpfreaks.com/topic/68918-solved-problem-updating/#findComment-346425 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.