Hi all, i am getting this error whats wrong in the following code
Warning: Invalid argument supplied for foreach() in D:\xampp\htdocs\demonew\contractor_testing_checkbox.php on line 24

<?php
session_start();
include('database.php');
$result = mysql_query("SELECT * FROM  autoalto_contractor" );
	
while($row = mysql_fetch_array($result))
 {
	extract($row); 
	$radio = unserialize($service_category); 
foreach($radio as $key )
	{ 
 echo $key." ";  
}

There is nothing in $service_category. It is empty. Thats the reason.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.