Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/68918-solved-problem-updating/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.