0

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
2
Contributors
5
Replies
32
Views
4 Years
Discussion Span
Last Post by thearts.beach
0

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

Edited by Unimportant

0

HI Unimportant,

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

Have tryed this and same error.

0

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

0
<?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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.