Re: [PHP] mysql_pconnect issue
On Mon, May 12, 2008 at 12:27 PM, Chris <[EMAIL PROTECTED]> wrote: > bruce wrote: > > hi... > > > > running into a problem that i can't seem to solve... > > > > using mysql_pconnect() and i'm trying to figure out what parameters have to > > be used in order to connect to a local mysql session, where mysql is > > accessed using the defaults (ie, no user/passwd/hostIP) > > Use 'localhost' for the host, no idea what you'd use for the user/pass, > but mysql requires a username at least. If you're not entering one, it's > using the username you are logged in as. > I guess the default user is 'root' and password is empty. - forcey > -- > Postgresql & php tutorials > http://www.designmagick.com/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert query result to array
I guess PDOStatement::fetchAll() should work? see http://www.php.net/manual/en/pdostatement.fetchall.php for details. - Forcey On Tue, May 13, 2008 at 9:55 AM, Yi Wang <[EMAIL PROTECTED]> wrote: > I think flance's meaning is whether there is a build-in function that > can convert the result set to an array. > > The short answer is: do it yourself. > > > > On 5/12/08, Stut <[EMAIL PROTECTED]> wrote: > > On 12 May 2008, at 15:56, It flance wrote: > > > > > is there any function that can convert the result of query to an > > associative array? > > > > > > what i want is the following: > > > > > > $query = "select * from tablename"; > > > $result = mysql_query($query); > > > $arr = somefunction($result); > > > > > > where $arr should be an assoiative array whose indices have the same name > > as the fields names of table tablename. > > > > > > > http://php.net/mysql_fetch_assoc > > > > Please please please read the manual: http://php.net/mysql > > > > -Stut > > > > -- > > http://stut.net/ > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > Regards, > Wang Yi > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php