Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form array to search to update

Status
Not open for further replies.

BitFuzzy

Technical User
Jun 8, 2001
343
US
I know I'm missing something.. but I've been staring at this code too long to see it.

I have a form array that contans unique referance numbers

I send the contents to another script that searches 4 tables for items belonging to the unique ref. numbers the results of which is supposed to update a different table.

$query = "update usrstat set eq$count = '$alt'
where refnum = '$refno[$i]' ";
$result2 = mysql_query($query) or die("Error");

I've changed while statements every which way to sunday, and keep getting the same error:

*********************************************************
Parse error: parse error, unexpected T_STRING
*********************************************************

any body have any ideas?

Thanks in advance
 
It could be your use of an array with a variable subscript inside a string literal. Try building your query string this way:

$query = "update usrstat set eq" . $count . " = '" . $alt . "' where refnum = '" . $refno[$i] . "'";


Want the best answers? Ask the best questions: TANSTAAFL!!
 
Thanks for the responce.

I found the problem, what was happening, is that towards the begining of the second script there was an additional line for a different array count. because of the location of this line, it (for some reason) was causing the error.

Once relocated, it worked fine.

Thanks again


**When in doubt, comment out **
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top