Questions tagged [fetchall]

165 questions
1
vote
1 answer

Where to add 3 functions & how to write findByUsername - Zend Framework

I have a User.php model, DbTable/User.php model and UserMapper.php file as described in the Zend Documentation. The mapper has a fetchAll(), find($id), getDbTable(), save() and setDbTable() If I want to add the following functions: function…
ews2001
  • 2,176
  • 3
  • 26
  • 38
1
vote
1 answer

Python sqlite fetchmany and fetchall return ordered results

I've noticed that the Python sqlite fetchall() and fetchmany() statements return results in sorted key order rather than the original key order. For example, consider: list_indexes = [9, 5, 2, 8, 3, 7] indexsize = len(list_indexes) cursor.arraysize…
Henry Thornton
  • 4,381
  • 9
  • 36
  • 43
0
votes
3 answers

MySQL PHP - How to remove unnecessary php echo text when mysql field is null?

I've got a client who wants me to format a list of businesses on a website page using data from a mysql database and putting it on the web page using php. The client wants each piece of data to be identified, like this: Contact Person: Sue Smith …
Kip Shaw
  • 79
  • 1
  • 1
  • 5
0
votes
1 answer

Why fetchall always results none?

I just need help to solve this, when I execute my code, the result of the fetchall is 'None', but these are the expected results (https://i.stack.imgur.com/OZL5R.png) this is my code def verificar_saldo(ID_MATE_PERD): conn_str =…
0
votes
0 answers

how to fetch request which has multiple queries inside using aiopg?

I use python aiopg package and want to group requests into big one using semicolons. I tried Cursor.nextset(), but it marked as "Not supported" It should be something like Query = ''' select * from product where id = 74; select id,…
VladVons
  • 27
  • 3
0
votes
0 answers

PHP fetchAll() returning empty array

I have a prepared query with 3 result sets. I used fetch() for the first two since they only have one row each and they are appearing correctly in the View. For the 3rd result set, it consists of several transaction rows and I used fetchAll(), but…
0
votes
0 answers

aiogram, fetch all from database and message in telegram bot by 5 rows with labeks

Good day,Everyone I am trying to build a telegram bot that fetchs all rows from database and shows message by 5 rows in tg bot with next page inline_keybord here is my code from aiogram import Bot, Dispatcher, executor, types import mysql.connector…
Jonibek
  • 84
  • 1
  • 7
0
votes
2 answers

must be compatible with PDOStatement::fetchAll(int $mode = PDO::FETCH_DEFAULT, mixed ...$args)

Our client has a drupal website, but the host has forced all clients from PHP 7.4 to PHP version 8, causing a PDO fatal error preventing the site from loading. Error Received: Fatal error: Declaration of Drupal\Core\Database\Statement::fetchAll(int…
0
votes
1 answer

Fetching data in Jupyter Notebook is taking too long

I want to fetch all rows from a table, using the following code: table_row_count = 1000000 batch_size = 10000 sql = """SELECT t.* FROM ( SELECT ROWNUM AS row_num, sub_t.* FROM ( SELECT name_employer FROM my_table …
0
votes
0 answers

Making Messagebox show results

(using python) In my section "Def display_record():" I can not get the messagebox.showinfo(results) to pop up and show the result. The error I get is "Expected type 'str | None', got 'list' instead" I tried a couple different version with my…
Riki
  • 9
  • 3
0
votes
0 answers

python+mysql : mysql.connector.errors.InterfaceError: No result set to fetch from

when query in PHPMyAdmin the result shows, but when query in python the error mysql.connector.errors.InterfaceError: No result set to fetch from. enter image description here this code can run for data in every year except 2019 select_mysql3 = """…
0
votes
1 answer

Fetchall() is excluding one row which is stored in fetchrow()

I am trying to create a code where i would get all the rows from the existing table if the condition matches otherwise return "Record is not there". Below fetchall() excludes one row which is sitting in fetchone() function. As i am new to this, i am…
Anonymous
  • 3
  • 3
0
votes
0 answers

Fatal error: Uncaught Error: Call to a member function fetchAll()

I know this question has been asked before but the answers found don't help me to find why my code is not working. I specify that I use WAMP under Windows, that the name of my database is "myapp" and I am looking for the results of the "posts"…
Flow
  • 33
  • 7
0
votes
2 answers

fetchAll getting stuck

I have the following code: $sql = "SELECT table.field, table2.field2 FROM table, table2"; $stmt = $this->db->prepare($sql); $stmt->execute(); $x = $stmt->fetchAll(PDO::FETCH_ASSOC); I know it is not enough…
luqita
  • 4,008
  • 13
  • 60
  • 93
0
votes
1 answer

pyodbc fetchall() not fetching all

I have Azure serverless functions which are connecting to a SQL database. One of the functions executes a stored procedure which in turn executes sub procedures, each of which produce a results set. in T-SQL: CREATE PROCEDURE usp_proc_1 AS SELECT…
Aaron Reese
  • 544
  • 6
  • 18