Jump to content
MakeWebGames

Recommended Posts

Posted
$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

Posted
$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 ';
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...