If I echo it out, i get this:
INSERT INTO stockk (company, indications, ticker, mkt_cap, price, change) VALUES (‘Pfizer Inc.’, ‘protein replace therapies / blood diseases / etc’, ‘PFE’, ‘178.6B’, ‘23.85’, ‘-0.38%’)
here is the code:
$quer1 = "INSERT INTO stockk (company, indications, ticker, mkt_cap, price, change) VALUES ('".addslashes($value['fullname'])."', '".addslashes($value['indic'])."', '".addslashes($value['symbol'])."', '".addslashes($mkt)."', '".addslashes($round)."', '".addslashes($value['PercentChange'])."')";
It is throwing a mysql syntax error….
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”change’) VALUES (‘Pfizer Inc.’, ‘protein replace therapies / blood diseases / e’ at line 1
The problem is that
changeis a reserved word in MySQL – you are using it in your columns list. If you wrap it in SQL quotes, the syntax error goes away.