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.. Quote Link to comment 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. Quote Link to comment 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]... Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.