troubleshooting Question

Oddly functioning php

Avatar of Richard Korts
Richard KortsFlag for United States of America asked on
PHP
5 Comments1 Solution79 ViewsLast Modified:
I have this code

<?php
	error_reporting(E_ERROR);
	ini_set('session.cache_limiter','public');
	session_cache_limiter(false);
	session_start();
	include "db_connect_nb.php";
	$qry = "SELECT * from selections";
	$res = mysqli_query($link, $qry);
	$nr = mysqli_num_rows($res);
	echo " nr = " . $nr . "<br>";
	$nx = 0;
	for ($i = 0; $i < $nr; $i++) {
		if ($i == 0){
			echo "entered loop<br>";
		}	
		$s = mysqli_fetch_array($res,MYSQLI_ASSOC);
		$qryo = "select * from proj_opts where pid = " . $s['pid'] . " and ruid = " . $s['ruid'];
		echo "qry from opts " . $qryo . "<br>";
		$reso = mysqli_query($qryo);
		$npo = mysqli_num_rows($reso);
		echo "npo =  ". $npo . "<br>";
		if ($npo != 0) {
			$qryu = "UPDATE sel_opts set selno = " . $s['selno'] . " where pid = " . $s['pid'] . " and ruid = " . $s['ruid'];
			echo "qry for uptade sel_opts = " . $qryu;
			$resu = mysqli_query($link, $qryu);
			$nx++;
		}	
	}
	echo $nx  . " records updated.";
	exit;
		
?>	

Part of the output (of the echos) is in the attached file.

I cannot see why the other echos in the same loop underneath the ones that show do not show.

Any ideas?
prod_objs_update.JPG
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 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 5 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