Jump to content

PDO fetchAll() 1-dimensional array


Eggzorcist

Recommended Posts

Hey there,

 

I've been looking through the PDO classes on php.net but am a bit confused by how to fetch a one dimensional array. Is this possible or will i have to fetch an assoc then transfer through a loop?

 

I've also heard of FETCH_INT as the fetching style but it's not in the php manual.

 

Any help..

Link to comment
https://forums.phpfreaks.com/topic/267810-pdo-fetchall-1-dimensional-array/
Share on other sites

An associative array can be one dimensional. Associative means it uses strings instead of numbers as the keys.

 

What are you having trouble with?

If you want one row, use fetch().

http://us.php.net/manual/en/pdostatement.fetch.php

 

Read the manual.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.