Skip to content
Advertisement

Tag: pdo

PHP/ADO Registration Submission [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 months ago. Improve this question ( ! ) Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ” for column ‘cust_b_country’ at row 1 in C:wampwwwecommerce-website-masterregistration.php on line

How to connet to my database with pdo in php

I want to get all data from my database table ‘user_info’ with PDO in PHP. My username is ‘root’ and the database is name ‘meta’. How to connect to it with PDO with PHP. Answer Try this:

Query return speed is fine but fetch is very slow

PostgreSQL 14 PHP 7.4 I have a PHP call that returns a handle to a scrollable cursor (PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) with about 760,000 records. The handle is being returned in a reasonable amount of time. However, once I have the handle back, doing nothing but fetching each record in a loop is taking over 12 minutes. I have tried it

PHP SQL Query to get the most common value in the table

I’m trying to have my query count the rows and have it return the most common name in that list, then from that it counts how many times that name appears and outputs the name and the amount of times its there This is the code I’m using: However, it just displays the first username in the table and counts

How can I update json column with a correct data type with PDO?

I have MySQL 5.7 and a query with PDO: But after it I’m having: id data 1 {“old_field”: 2, “new_field”: “1”} Why does my new value have a string type? Expected table: id data 1 {“old_field”: 2, “new_field”: 1} I have success without using PDO(JSON_OBJECT(‘new_field’, 1)), but I have a string type with using placeholders. Answer When you pass an

PHP script does not execute the MYSQL command

I want to update price on invoice with this PHP code (the config file is included, more SQL statements are executed above this): full code (html form): Whole script and things around are working, but the MYSQL exec. isnt working for some reasons (no errors at all) Answer This: should be: Don’t put parameter placeholders inside any kind of SQL

Assign value PHP variable as column name during fetching

I am trying to fetch the values from columns in a MySQL table using PHP. The variable $batch_id is dynamic, i.e. it changes column name depending on the request. Say, it can adopt value like ‘Batch1’ or ‘Batch10’. I was able to extract the column name into the $batch_id variable, but when I am passing the column name, say ‘Batch10’

Advertisement