Imtehbegginer Posted October 13, 2006 Share Posted October 13, 2006 Hi guys,I am developing a script for a friend, and im creating a sort of admin script, and in the mysql database, the column 'accesslevel' has to be 300 for you to access it.Can someone write a little code to show meh how to do it?Thanks. Link to comment https://forums.phpfreaks.com/topic/23905-selecting-column-values/ Share on other sites More sharing options...
fezzik Posted October 13, 2006 Share Posted October 13, 2006 Is the user(admin) to have an 'accesslevel' associated with him/her which allows them access to certain information in the database or are you looking to retrieve all database rows where a column called 'accesslevel' has a value of 300?If it is the latter then you will need something like:$result = mysql_query("select * from table_name where accesslevel = 300");while($row = mysql_fetch_array($result)) {// reference either the column name: $row['email'] or column number: $row[0]echo $row['column_0'];echo $row['column_1'];echo $row['column_2'];echo $row['column_3'];}If provide more information I can probably be of more assistance.Cheers,Fezzik Link to comment https://forums.phpfreaks.com/topic/23905-selecting-column-values/#findComment-108660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.