|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
I face a problem when i want to retrieve array data using php from mysql database. $testplatform=unserialize($row8['test_platform']); foreach($testplatform as $my_test_platform){ print "<table border=\"0\" height=\"100%\" width=\"100%\"><tr><td class=\"font10\" bgcolor=\"$color\">$my_test_platform</td></tr></table> "; the code above works well. The problem is, i want to retrieve another array data from database that is for the $color at the same time but i cant do well for this. How can i put another foreach in order to retrieve array data for $color? or can one of you recommend the best way to solve the problem? I do appreciate anyone's help! Regards; Dulcinea |
|
#2
|
|||
|
|||
|
Is it possible to retrieve an array data one by one?
Please, I need someone explanation! regards; Dulcinea |
|
#3
|
||||
|
||||
|
I don't understand your question.
Here is an example of getting array data one by one PHP Code:
|
|
#4
|
|||
|
|||
|
This is my code:
$type_package=unserialize($row7['type_package']); $status1=unserialize($row18['status1']); foreach( $status1 as $mystatus1 ) { foreach( $type_package as $my_type_package ){ print "<table border=\"0\" height=\"100%\" width=\"100%\"><tr><td bgcolor=\"#FDEAFD\" class=\"font10\">$mystatus1 $my_type_package </td></tr></table> "; } } for instance; $mystatus={1,2} and $my_type_package={a,b} so, the output for the above coding is 1a,1b,2a,2b. How can i manage to get only 1a2b instead of 1a1b2a2b? That is the problem that i face actualy. I hope there is someone out there can help me to solve the solutions! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Retrieve array data using php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|