select Posted October 29, 2009 Share Posted October 29, 2009 Hi I have a drop-down list and need to have more then one value to just one option. echo "<option value=" . $row['ii'], $row['bi'] . ">" . $row['io'] . "</option>"; So I somehow need to split the two values so I can use each individually. Quote Link to comment https://forums.phpfreaks.com/topic/179496-solved-select-option-value-form-more-than-one-value/ Share on other sites More sharing options...
JonnoTheDev Posted October 29, 2009 Share Posted October 29, 2009 Bad syntax echo "<option value='".$row['ii'].",".$row['bi']."'>".$row['io']."</option>\n"; Quote Link to comment https://forums.phpfreaks.com/topic/179496-solved-select-option-value-form-more-than-one-value/#findComment-947096 Share on other sites More sharing options...
select Posted October 29, 2009 Author Share Posted October 29, 2009 Thank you. I have put the values into a session. [article_id] => 13,2 What I am trying to do is the following; get the first value, here 13, in a session. [article_id] => 13 Then get the second value, here 2, into a different session. [picture_id] => 2 Quote Link to comment https://forums.phpfreaks.com/topic/179496-solved-select-option-value-form-more-than-one-value/#findComment-947173 Share on other sites More sharing options...
JonnoTheDev Posted October 29, 2009 Share Posted October 29, 2009 $x = "13,2"; $vals = explode(",",$x); $articleId = $vals[0]; $pictureId = $vals[1]; Quote Link to comment https://forums.phpfreaks.com/topic/179496-solved-select-option-value-form-more-than-one-value/#findComment-947188 Share on other sites More sharing options...
select Posted October 29, 2009 Author Share Posted October 29, 2009 Thank you so much. It is perfect. Quote Link to comment https://forums.phpfreaks.com/topic/179496-solved-select-option-value-form-more-than-one-value/#findComment-947204 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.