SilvaTungDevil Posted July 2, 2013 Posted July 2, 2013 $list = mysql_query("SELECT name, email FROM ".$_POST['db1'].""); $mailList = array(); while($data = mysql_fetch_array($list)) { $mailList[$list['name']] =$list['email']; } echo '<br /> var dump <br />'; var_dump($mailList); echo '<br /> var dump <br />'; Is what im trying to do but it just returns: array(1) { [""]=> NULL } Any help would be appreciated Quote
sniko Posted July 2, 2013 Posted July 2, 2013 $list = mysql_query("SELECT name, email FROM ".$_POST['db1'].""); $mailList = array(); while($data = mysql_fetch_array($list)) { $mailList[$data['name']] =$data['email']; } echo ' var dump '; var_dump($mailList); echo ' var dump '; Quote
Dave Posted July 2, 2013 Posted July 2, 2013 Swear you asked me this over Skype? My fault doing $list instead of $data inside the loop, that's what you get for typing straight into PasteBin. Closing thread as it's resolved. Quote
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.