How do I pass two different arrays of variable at the same time on the same SELECT drop down.[Please look my code]

Table: favorits : id, url, title, f_id;//f_id =
      users:   id, password

Case "tools":
           print("<h3>Url Selected</h3>\n");             
                   $ar = $_POST['uselect'];
/*I want to input `url` and `title` in my database, I am only passing `url` via    select [] and accesing it,
# but how do I passs `title` also through same select without using another drop down menu.
#I know you can AGAIN look in to database for` title`, but that is not what I want, since I already have  `title` in my  $result2 array, and on $a and on $d (please look below)*/

      $result = @mysql_query(" SELECT url,title FROM favorites where ='$k'");//User id
          if (!$result) {
            exit('<p>Error performing query: ' . mysql_error() . '</p>');
      while ($row = mysql_fetch_array($result)) {
           $result1 = array_merge((array)$result1, (array)($row['url']) );
           $result2 = array_merge((array)$result2, (array)($row['title']) );

      $a = array_combine($result2,$result1); ///////// ARRAY $a
      $d = array_map("map_Spanish", $result2 , $result1);// ///////// ARRAY $d

      $num = mysql_numrows($result);
         print("<form action=\"webtools.php?section=tools\" method=\"post\"> ");
         $i = 0;
         print( "<SELECT name=\"uselect[]\" SIZE=\"1\">");
                  foreach($a as $key=>$val) {
                        echo "<OPTION VALUE=\"".$val."\">". $key ."</OPTION>\n";            
           print( "</SELECT>");
         echo " <br> <br>";
         $num = $num -1;
      print("<input type=\"submit\">\n");


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

you could concatenate the two using some separator which won't occur in either one, such as | or :, and then use explode() to break it back into pieces.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
questionphpkAuthor Commented:
I was thinking of something like this, but you are right it is hard to find a cleverer answer.
Thanks for yours answer.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.