Jump to content

[SOLVED] DB Array


Canman2005

Recommended Posts

Hi all

 

Wondering if anyone can help.

 

I have the following array code

 

  $name_array =  array ('steve', 'jon', 'george', 'admin');

  if (in_array($input, $name_array)) {
    return true;
  }
  else {
    return false;
  }

 

and I want to run a SQL QUERY for the array data using something like

 

$sql = "SELECT * FROM `members`";
$show = @mysql_query($sql,$connection) or die(mysql_error());
while ($row = mysql_fetch_array($show))
{
}

 

which would replace the

 

'steve', 'jon', 'george', 'admin'

 

part of the array with data from the SQL database.

 

Can anyone help? Been on this for 6 hours and im not managing to crack it.

 

Any help would be ace

 

Thanks in advance

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/107407-solved-db-array/
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.