Ingolme 1,020 Posted May 30, 2020 Report Share Posted May 30, 2020 You will probably run into a syntax error because the values are not quoted. Quote Link to post Share on other sites
Elton 0 Posted May 30, 2020 Author Report Share Posted May 30, 2020 https://prnt.sc/sqsjr8 Quote Link to post Share on other sites
Ingolme 1,020 Posted May 30, 2020 Report Share Posted May 30, 2020 From that error is looks as if you forgot to put a $ on your variable name on line 12. Quote Link to post Share on other sites
Elton 0 Posted May 30, 2020 Author Report Share Posted May 30, 2020 https://prnt.sc/sqsm7i it seems like it works partially but it imports incorrectly Quote Link to post Share on other sites
Ingolme 1,020 Posted May 30, 2020 Report Share Posted May 30, 2020 Your update query does not have a WHERE clause, so it updates every single row in the table. Use a WHERE clause to restrict the update to a particular row. See examples in the MySQL tutorial: https://www.w3schools.com/sql/sql_update.asp Quote Link to post Share on other sites
Elton 0 Posted May 30, 2020 Author Report Share Posted May 30, 2020 $query = "UPDATE `$dbname` SET name='%s', url='%s', short='%s', game='%s' WHERE name;"; Quote Link to post Share on other sites
Ingolme 1,020 Posted May 30, 2020 Report Share Posted May 30, 2020 If that works, it probably will update any row which has a name. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.