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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.