I have an array that takes data from a mysql query.
$mysql = "select distinct name from software";
$result = mysqli_query($conn, $mysql);
while($myrow = mysqli_fetch_assoc($result)) {
$array[] = $myrow;
}
What I would like to do is to have the data output like:
item1, item2, item3
In the end what I want to do is to be able to store that info in a variable to use for a mysql query
$array = item1, item2, item3
select * from table where item != ($array)
However I cannot get the data to output correctly,
If I use print_r the data is shown and the array is good.
If i use array_key() I only get the numbers, how can I get the names?
print_r output:
( [0] => Array ( [name] => Skype for Business Basic 2016 - en-us ) [1] => Array ( [name] => Microsoft Visual C++ 2008 Redistributable - x64 9. ) [2] => Array ( [name] => Microsoft Office 365 Business - en-us ) [3] => Array ( [name] => Microsoft Silverlight ) [4] => Array ( [name] => NVIDIA 3D Vision Driver 341.92 ) [5] => Array ( [name] => NVIDIA Graphics Driver 341.92 ) [6] => Array ( [name] => NVIDIA Update 10.4.0 ) [7] => Array ( [name] => NVIDIA HD Audio Driver 1.3.30.1 ) [8] => Array ( [name] => FortiClient ) )
implode(', ', $array)?sql not in