johnhb Posted March 12, 2008 Share Posted March 12, 2008 I have the following code: $query=mysql_query('SELECT pay, name FROM paychart, users WHERE paychart.payee = users.id') or die(); which I want to put into an array so that I can 1) eliminate duplicate values of pay and then 2) find the lowest value of pay and have the payee's name to match that pay. I have tried this: while ($array = mysql_fetch_array($query, MYSQL_NUM)) { $data[] =$array[0]; $data1[] =$array[1]; } But I want the pay and name to be in the same array. Hope someone can help me? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 12, 2008 Share Posted March 12, 2008 while ($array = mysql_fetch_row($query)) { $data[] =$array; } Quote Link to comment Share on other sites More sharing options...
johnhb Posted March 12, 2008 Author Share Posted March 12, 2008 Thank you very much - it's so simple when you know how. 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.