kate_rose Posted June 12, 2008 Share Posted June 12, 2008 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 Link to comment https://forums.phpfreaks.com/topic/109901-newbee-transfer-data-from-mysql-to-php-array/ Share on other sites More sharing options...
jonsjava Posted June 12, 2008 Share Posted June 12, 2008 you'll need to do a mysql_fetch_assoc and a while loop. Link to comment https://forums.phpfreaks.com/topic/109901-newbee-transfer-data-from-mysql-to-php-array/#findComment-563929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.