d22552000 Posted September 3, 2007 Author Share Posted September 3, 2007 Where does stdntid1, stdntid2, stdntid3 etc come into it? Or is stdntid supposed to be clsid? ya its STDNTID not clsid sry. isnt this case sensative... LOL Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Share Posted September 3, 2007 So.. does it work for you? Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Author Share Posted September 3, 2007 does what? and can you guys also help me here: http://www.phpfreaks.com/forums/index.php/topic,157868.0.html ? thats on the same script -,-. Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Share Posted September 3, 2007 Um.. the solution that I just posted for you..? Right above your post..? Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Author Share Posted September 3, 2007 ***COMMON SENSE*** so uh... got any ideas people? and do you have any code examples plz? Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Share Posted September 3, 2007 ***COMMON SENSE*** Yes, that's it, common sense! Use it. Like when you have a problem, and I give you the solution, maybe try to make use of it, and, who knows, maybe even say "thank you"? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted September 3, 2007 Share Posted September 3, 2007 Post me the output of this: while($row = mysql_fetch_array($res, MYSQL_ASSOC)) { echo '<pre>' . print_r($row, true) . '</pre>'; } Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Author Share Posted September 3, 2007 but uh ya.. how would I use it I dont understnad your solution. siomething about seperating by commas? Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Author Share Posted September 3, 2007 Array ( [CLSID] => 101 [sTDID1] => 1 [sTDID2] => 2 [sTDID3] => 3 [sTDID4] => 4 [sTDID5] => 5 [sTDID6] => 6 [sTDID7] => 7 [sTDID8] => 8 [sTDID9] => 9 [sTDID10] => 10 [sTDID11] => 11 [sTDID12] => 12 [sTDID13] => 13 [sTDID14] => 14 [sTDID15] => 15 [sTDID16] => 16 [sTDID17] => 17 [sTDID18] => 18 [sTDID19] => 19 [sTDID20] => 20 [sTDID21] => 21 [sTDID22] => 22 [sTDID23] => 23 [sTDID24] => 24 [sTDID25] => 25 [sTDID26] => 26 [sTDID27] => 27 [sTDID28] => 28 [sTDID29] => 29 [sTDID30] => 30 [sTDID31] => 31 [sTDID32] => 32 [sTDID33] => 33 [sTDID34] => 34 [sTDID35] => 35 ) as I said, lots of STDID. oh im an idiot. thtas why yoru code didnt wkr cause I told yiou STDNTID but this table uses STDID -,- all my other tables use STDNTID. omfg im a frekin moron. m trying your code with STDID and seein if it works.. Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Author Share Posted September 3, 2007 while($row = mysql_fetch_array($res, MYSQL_ASSOC)) { // get total items in the $row array $items = count($row) - 1; // now that we not how many items are in the $row array, // we can use a for loop to loop through the array for($i = 1; $i <= $items; $i++) { echo $row['STDID' . $i] . '<br />'; } } works now, IM AN IDIOT. fuck -,-. now im not gonna say solved yet cuase i bet thers gonna be another problem in like a second -,-. ill rely with the new problem lol. Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Share Posted September 3, 2007 but uh ya.. how would I use it I dont understnad your solution. siomething about seperating by commas? Uh ya.. maybe by reading? If you honestly can't understand a simple solution and are to lazy to search, fine, I'm feeling really nice today, so I'll just hold your hand and walk you through it and do it all for you okay, even though it should be easy as hell for you to. In your mysql query, the place where you have the columns that you want to output.. put concat_ws(',', In front of the rows you have in your query.. the row1,row2,row3 or whatever.. and put a ) at the end of them Now instead of all those rows being selected separately, it selects them like "Value1,Value2,Value3" So now you use the PHP "explode" function to turn it into a nice little array and use foreach on it and voila. In the future please look up on php.net or mysql.com if there is a function or something that you don't understand. I really prefer teaching people how to fish instead of just giving fish.. so I'm doing both for you since you don't want to get this fish yourself.. have fun ^^ Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Author Share Posted September 3, 2007 Thank you AZU for explaingin that you wanted me to use a comma. I did not understand your post and frankly, im tired -,-. I have been working on this for a while. except for the page size being about 2.1MB it worked out thanks solved. I can stand the size since this is being used on a T1 connection by teachers in a district or by lan. Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Share Posted September 3, 2007 Hm no I wasn't explaining that "I wanted you to use a comma". Where the hell did that come from? I was solving your problem for you, and teaching you how to easily solve your problems on your own in the future. Anyways, you're welcome. Quote Link to comment 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.