Eggzorcist Posted August 30, 2012 Share Posted August 30, 2012 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 More sharing options...
Jessica Posted August 30, 2012 Share Posted August 30, 2012 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. Link to comment https://forums.phpfreaks.com/topic/267810-pdo-fetchall-1-dimensional-array/#findComment-1373862 Share on other sites More sharing options...
Eggzorcist Posted August 30, 2012 Author Share Posted August 30, 2012 I want multiple rows but the output needs to be $values = array( 1 => "value1"); so I can grab them with values[1]...values[4]... Link to comment https://forums.phpfreaks.com/topic/267810-pdo-fetchall-1-dimensional-array/#findComment-1373872 Share on other sites More sharing options...
Jessica Posted August 30, 2012 Share Posted August 30, 2012 Did you read the manual like I said? The page I linked to tells you how to do that. Link to comment https://forums.phpfreaks.com/topic/267810-pdo-fetchall-1-dimensional-array/#findComment-1373873 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.