Jump to content

PHP in Array


egturnkey

Recommended Posts

Hello guys ,

 

How to recall from database inside array

 

 

Is that right or wrong ??

 

 


require_once("../includes/config.php");


$q1 = "select * from egadmin";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);


$LOGIN_INFORMATION = array(

  '$a1[username]' => '$a1[password]'

);


Link to comment
https://forums.phpfreaks.com/topic/188643-php-in-array/
Share on other sites

It seems that he would like to use the value of field username as an array key and the value is the password.. Try this.

 

require_once("../includes/config.php");


$q1 = "select * from egadmin";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);


$LOGIN_INFORMATION = array(

  '$a1['username']' => '$a1['password']'

);

 

 

Your friend,

Alexies

 

Link to comment
https://forums.phpfreaks.com/topic/188643-php-in-array/#findComment-995910
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.