Heres my code which is suppose to update a number of rows and bind them to a user id which is a primary key from another table but I keep getting
Parse error: parse error, unexpected T_VARIABLE in uppdaterar_kunder.php on line 45
I think I have tried all kinds of known quotations, but maybe I am attacking this the wrong way
Thanks!
<?php require_once('Connections/MySQL.php'); ?>
<?php
$colname_anstalld = "1";
if (isset($HTTP_GET_VARS['anstallnings_id'])) {
$colname_anstalld = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['anstallnings_id'] : addslashes($HTTP_GET_VARS['anstallnings_id']);
}
mysql_select_db($database_MySQL, $MySQL);
$query_anstalld = sprintf("SELECT * FROM employees WHERE anstallnings_id = %s", $colname_anstalld);
$anstalld = mysql_query($query_anstalld, $MySQL) or die(mysql_error());
$row_anstalld = mysql_fetch_assoc($anstalld);
$totalRows_anstalld = mysql_num_rows($anstalld);
$maxRows_MCI_free = 3;
$pageNum_MCI_free = 0;
if (isset($HTTP_GET_VARS['pageNum_MCI_free'])) {
$pageNum_MCI_free = $HTTP_GET_VARS['pageNum_MCI_free'];
}
$startRow_MCI_free = $pageNum_MCI_free * $maxRows_MCI_free;
mysql_select_db($database_MySQL, $MySQL);
$query_MCI_free = "SELECT * FROM par100 WHERE saljare_anstallnings_id = '16'";
$query_limit_MCI_free = sprintf("%s LIMIT %d, %d", $query_MCI_free, $startRow_MCI_free, $maxRows_MCI_free);
$MCI_free = mysql_query($query_limit_MCI_free, $MySQL) or die(mysql_error());
$row_MCI_free = mysql_fetch_assoc($MCI_free);
if (isset($HTTP_GET_VARS['totalRows_MCI_free'])) {
$totalRows_MCI_free = $HTTP_GET_VARS['totalRows_MCI_free'];
} else {
$all_MCI_free = mysql_query($query_MCI_free);
$totalRows_MCI_free = mysql_num_rows($all_MCI_free);
}
$totalPages_MCI_free = ceil($totalRows_MCI_free/$maxRows_MCI_free)-1;
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>Uppdaterar <?php echo $row_anstalld['namn']; ?>'s kontakter</p>
<p>
<?php do { ?>
<?php mysql_query(UPDATE par100 SET (saljare_anstallnings_id=$HTTP_GET_VARS[anstallnings_id]) where (primarnyckel=$row_MCI_free['primarnyckel'])) ?>
<?php } while ($row_MCI_free = mysql_fetch_assoc($MCI_free)); ?>
</p>
</body>
</html>
<?php
mysql_free_result($anstalld);
mysql_free_result($MCI_free);
?>
[code=php]<?php require_once('Connections/MySQL.php'); ?>
<?php mysql_query(UPDATE par100 SET (saljare_anstallnings_id=$HTTP_GET_VARS[anstallnings_id]) where (primarnyckel=$row_MCI_free['primarnyckel'])) ?>