Jump to content

NewBee transfer data from mysql to php array


kate_rose

Recommended Posts

I am running wampserver.

I have created a mysql database.

I want to get a single column of data from my db and load it into a php array.

 

I have looked at a number of example scripts but none seem to do what I want.

I have a mysql book & I pretty well understand how to retrieve data in the mysql console.

 

When retrieving data from mysql using php do I have to use one of the preset commands such as 'msyql_fetch_assoc'?

Or is there a way to send mysql commands directly to get a column of data  & put it in a php array without using a where loop in php?  It just seems really cumbersome.

As far as I can tell all the php mysql commands retrieve a whole row of data.  At the console you can specify exactly what data you want and can get data from only one column. 

 

I guess my main problem is that I am new & I don't understand exactly how php & mysql interact.

Could someone please provide an explanation or refer me to a link.

 

Don't mean to be dense,

 

Kate

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.