troubleshooting Question

Php error with an array

Avatar of Richard Korts
Richard KortsFlag for United States of America asked on
PHP
2 Comments1 Solution81 ViewsLast Modified:
I have this code:
$ckd_sels = array();
	$nc = 0;
	for ($i = 0; $i < $ns; $i++) {
		$s = mysqli_fetch_array($ress,MYSQLI_ASSOC);
		$cbnam = $s['pid'] . "-" . $s['ruid'] . "-" . $s['selno'];
		$ck = "ck" . $cbnam;
		echo "ck + cbnam = " . $ck . "<br>";
		echo  "checked = " . $_POST[$ck] . "<br>";
		if ($_POST[$ck] == "on") {
			echo "post-ck = " . $_POST[$ck] . "<br>";
			$ckd_sels[$i] = $ck;
			echo "ckdcells = " . $ckd_sels[$i] . "<br>";
			$nc++;
		}
	}
	echo "ckd_sels array = " . $ckd_sels . "<br>";
	$_SESSION['ckdsels'] = $ckd_sels;

The last part of the output looks like the attached. Something is wrong with my array definition (I think)

Any help?
Array.JPG
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros