It is estimated that it is a punctuation problem. I can't find it. I want to help you.
for($i=0;$i<$num;++$i){ $ming=$a1[$i]; $zjming=$a2[$i]; $zjtime=$a3[$i]; $mysqli->query('update xs set xinzhangjie='$zjming',zhangjieshijian='$zjtime' where xsMing='$ming''); printf("Affected rows (UPDATE): %d ", $mysqli->affected_rows); echo $ming.'---';
MYSQLI returns-1, indicating that the execution department is successful.
You can update a single-pick statement.
All variables can be recycled out of values. It is loop update, and it won't work. it is estimated that it is the punctuation of the update statement. I have tested many types of punctuation.
For example.
Xinzhangjie = '". $ zjming."' No
Xinzhangjie = '{$ zjming}' no
Xinzhangjie = "$ zjming" no
Xinzhangjie = ". $ zjming." No
..... My head is big.
Reply to discussion (solution)
$ Mysqli-> query ("update xs set xinzhangjie = '$ zjming', zhangjieshijian = '$ zjtime' where xsMing =' $ Ming '");
Double quotation marks
$ Mysqli-> query ("update xs set xinzhangjie = '$ zjming', zhangjieshijian = '$ zjtime' where xsMing =' $ Ming '");
Thank you so much, bro.
Double quotation marks
OK. Thank you for your help.
Use a hyphen to link strings and variables ..
The connection character is "."
Single quotes do not parse PHP variables...
So...
Single quotes do not parse PHP variables...
So...
Use a hyphen to link strings and variables ..
The connection character is "."
Therefore, double quotation marks are used. Now I understand. Thank you !~!~!~