Jump to content

How to number results within the variable


laural
Go to solution Solved by requinix,

Recommended Posts

Here is part of my code, what I am wondering is, how do I streamline this (there are many more lines that I cropped for this example) - also, I was playing with using $i, but I keep getting errors when trying to insert it to my variables below...  hopefully this is a pretty basic question... thanks :)

 

			// LOOP - SET SERVICE INFORMATION - START
			while( $row3 = sqlsrv_fetch_array( $stmt3, SQLSRV_FETCH_ASSOC) ) {

				// SET PARAMETERS - SET SERVICE INFORMATION
				$id_division_00='d'.trim($row3["id_division_00_translated_calc"]);				$id_division_01='d'.trim($row3["id_division_01_translated_calc"]);

				$divisions_services_00_description=$row3["divisions_services_00_description"];				$divisions_services_01_description=$row3["divisions_services_01_description"];

				$id_module_001='m'.trim($row3["id_module_001"]);
				$id_module_002='m'.trim($row3["id_module_002"]);
				$id_module_003='m'.trim($row3["id_module_003"]);
				
				$svc_module_001=trim($row3["svc_module_001"]);
				$svc_module_002=trim($row3["svc_module_002"]);
				$svc_module_003=trim($row3["svc_module_003"]);

				// SET SESSIONS - SET SERVICE INFORMATION
				$_SESSION['id_d00']=$id_division_00;
				$_SESSION['id_d01']=$id_division_01;

				$_SESSION['divisions_services_00_description']=$divisions_services_00_description;				$_SESSION['divisions_services_01_description']=$divisions_services_01_description;
				
				$_SESSION['id_m001']=$id_module_001;
				$_SESSION['id_m002']=$id_module_002;
				$_SESSION['id_m003']=$id_module_003;

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.