Questions tagged as 'pdo'

1
answer

Problems in searching for data by name, does not return anything

I'm having trouble fetching data by name. The following is the code. Thanks in advance. <?php include_once 'dbconfig.php'; ?> <?php include_once 'header3.php'; ?> <div class="clearfix"></div> <div class="containe...
asked by 29.03.2017 / 11:48
1
answer

SQLSTATE [42000]: Syntax error or access violation: 1064

I'm having trouble viewing and entering data into the database, it's giving this error:    SQLSTATE [42000]: Syntax error or access violation: 1064 You have an   error in your SQL syntax; check the manual that corresponds to your   MariaDB se...
asked by 22.03.2017 / 23:57
1
answer

PDO inserting null

I'm trying to create a simple user registration screen, but I'm having trouble performing insert . The method is executed but MySQL inserts null instead of form fields that I get through a foreach , can you tell me wher...
asked by 20.03.2017 / 20:15
1
answer

PHP PDO does not insert value

I do not quite understand PHP, but I'm trying to create a PDO connection. The connection works fine but does not enter the values ... follow the code: config define("DB_HOST", "localhost"); define("DB_USER", "root"); define("DB_PASSWORD"...
asked by 14.04.2017 / 18:29
1
answer

Fatal error: Call a member function prepare () on a non-object

I am creating a class to perform querys on the database, but I am having the following error when I have to use prepared statements:    Fatal error: Call a member function prepare () on a non-object in   C: \ xampp \ htdocs \ MyOffices \ php...
asked by 24.05.2017 / 01:07
1
answer

Undefined Variable using this

I am creating a basic class for operations in the database, but apache returns me two errors on line 12. Because the connection is an attribute I refer to this . Why in the first reference at the time of connecting to db the error is not g...
asked by 23.05.2017 / 21:08
2
answers

How to get the POST value and save it to the bank

View image: ImageoftheBank Code$nome_plano=trim($_POST["nome_plano"]); $quemcadastrou = $userRow['nome_funcionario']; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn->setAt...
asked by 27.01.2017 / 21:04
1
answer

Error Call to a member function prepare

The connection to the database is working perfectly, but the getList method returns this error: Fatal error: Uncaught Error: Call to a member function prepare() on null in /opt/lampp/htdocs/site/config/config.class.php:32 Stack trace: #0 /opt/...
asked by 08.03.2017 / 23:59
1
answer

Error when using PDO: "Call a member function query () on a non-object in ..."

I am trying to make a query in the database, however I get the following error:    Fatal error: Call to a member function query () on a non-object in C: \ wamp \ www \ site-news \ Class \ Publication.class.php on line 37 I created a class...
asked by 04.01.2017 / 14:50
1
answer

How to see the amount of results with PDO

Good evening, How do I use, do I count the amount of results of a select in the database using PDO? <?php ini_set('display_errors', true); error_reporting(E_ALL); header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Me...
asked by 17.06.2016 / 05:15