Hey guys,
iam a beginner in programming and i start to write my first PHP Script for LogIn and adding Values in MySQL Database (add_data.php). The LogIn works fine but the script is not able to add some Values in my Database. I use the following SQL Function “INSERT INTO” to put my Values in the Database. For example:
$sql = “INSERT INTO customer
(name
, surname
, email
) VALUES (‘tom’, ‘tom123’, ‘tom321@gmx’)”;
It didn’t work
While iam loged in at PHPMyAdmin at 000webhost and select my Database as well as my table (customer), click on SQL and execute the same function as above, the values are added.
The SQL Function seems to be ok because it works, if you execute them over the Webpage, but where is the Problem to execute the same function over the PHP Script??? Is it not allowed to create databases, tables or adding values with an external script?
Please Help me to understand whats going wrong. Sorry for my English…I hope you understand my problem.
Niko