Skip to content

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 in…

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 ta…

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 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 param…

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 w…