I am trying to update the shirtnumbers in table crew, by the ID from the .php page before.

<?php
include('conect.php');
$page = (isset($_GET['page'])) ? $_GET['page'] : 1;
$startPoint = $page - 1;
$data = "UPDATE crew SET shirtnumber=$POST['shirtnumber'] WHERE ID=<?php $_GET['ID']?>";
$query = mysql_query($data);
$data2 = mysql_fetch_array($query);
$rowCount = 0;
?>

this give me this error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/a3825974/public_html/page3.php on line 5

$data = "UPDATE crew SET shirtnumber=$_POST['shirtnumber'] WHERE ID=$_GET['ID']";

HI Unimportant,

$data = "UPDATE crew SET shirtnumber=$_POST['shirtnumber'] WHERE ID=$_GET['ID']";

Have tryed this and same error.

Can you verify that $_POST['shirtnumber'] and $_GET['ID'] are real?
What happens if you echo them?

if i use this line

$data = "SELECT * FROM crew ORDER BY id ASC LIMIT $startPoint,1";

i get the output #1 #1 ie. shirtnumber# = 1 and ID# = 1

<?php
include('conect.php');
$data = "SELECT * FROM crew WHERE ID=$idpage1";
$query = mysql_query($data);
$data2 = mysql_fetch_array($query);
$idpage1 = $_POST['ID'];
?>

gives me the error message

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a3825974/public_html/page3.php on line 5

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.