Php runs normally on the computer, but does not solve the problem properly on the linux Terminal.
Source: Internet
Author: User
Php runs normally on the computer but does not solve the problem properly on the linux Terminal. My php file content: always prompts & nbsp; fatal & nbsp; error; & nbsp; call & nbsp; to & nbsp; a & nbsp; member & nbsp; function & nbsp; query () & nbsp; on & nbsp; a & n php runs normally on the computer but does not work properly on the linux Terminal.
My php file content:
Always prompts fatal error; call to a member function query () on a non-object online 16
$ DB-> connection-> query ("create table test (id integer primary key, name varchar (50), grade varchar (50), score varchar (50 ))"); this line of error always prompts me to paste it here
It is completely normal for me to run on the computer. I can insert data. when I run the data on a linux Terminal, I keep prompting that the error is going crazy. Is it a problem with terminal settings?
// Obtain the data submitted on the uiceshi.html page
$ Fname = $ _ POST ['fname']; // name
$ Fgrade = $ _ POST ['fgrade ']; // grade
$ Fscore = $ _ POST ['fscore']; // score
// $ SQL = 'Insert into test values ();';
// Create a database instance
$ DB = new SQLite ('Blog. db'); // the database file name is arbitrary.
// Create a table named test
$ DB-> connection-> query ("create table test (id integer primary key, name varchar (50), grade varchar (50), score varchar (50 ))"); this line of error is prompted
// Execute the insert statement
// $ Result = $ DB-> query ("insert into test (name, grade, score) values ('". $ fname. "','". $ fgrade. "','". $ fscore. "')");
$ Result = $ DB-> connection-> query ("insert into test (name, grade, score) values ('". $ fname. "','". $ fgrade. "','". $ fscore. "')");
// The returned results are mainly used for debugging.
Print_r ($ result );
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.