laural Posted March 6, 2013 Share Posted March 6, 2013 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; Quote Link to comment https://forums.phpfreaks.com/topic/275311-how-to-number-results-within-the-variable/ Share on other sites More sharing options...
Solution requinix Posted March 6, 2013 Solution Share Posted March 6, 2013 It looks like you have data normalization problems. Are you able to change the database structure? What do the tables look like? Quote Link to comment https://forums.phpfreaks.com/topic/275311-how-to-number-results-within-the-variable/#findComment-1416973 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.