Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8013089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:32:13+00:00 2026-06-04T19:32:13+00:00

So, i got a pretty bad database that i CAN’T transform. The string is

  • 0

So, i got a pretty bad database that i CAN’T transform.

The string is 5numbers like: 180,2345,123,5643,23534

I need to put those numbers(need to explode somehow) in a select option like this:

<select name="hotel" id="hotel" class="fieldbackend">
<option value="403">403</option>
<option value="880">880</option>
<option value="983">983</option>
<option value="648">648</option>
</select>

Presently i got this result:

<select name="hotel" id="hotel" class="fieldbackend">
<option value="undefined">undefined</option>
<option value="undefined">undefined</option>
<option value="undefined">undefined</option>
<option value="undefined">undefined</option>
<option value="403,880,983,648">403,880,983,648</option>
</select>

There is my source code:

<select class="fieldbackend" id="destination" name="destination">
     <option value="">-- Destination --</option>
</select>

<select class="fieldbackend" id="hotel" name="hotel">
     <option value="">-- Hôtel --</option>
</select>

There is my JS:

$(function(){
    $('#destination').change(function(){
        $.getJSON('/dev/select2.php', {'destination': $(this).val()}, function(data) {
            var items = '';
            $.each(data, function(key, val) {
                items += '<option value="' + val['deHotels'] + '">' + val['deHotels'] + '</option>';
            });

        $('#hotel').html(items);
        });
    });
})

Finaly there is my php code:

$requete = "SELECT DISTINCT deHotels FROM sirev_Dests WHERE deDestName = '". $_GET['destination'] ."' ORDER BY deDestName";
    $connect = mysql_connect("&&&&&&&&&&&&&&&","&&&&&&&&&&&&&&&","&&&&&&&&&&&&&&&");

    mysql_select_db("&&&&&&&&&&&&&&&", $connect);

    $res = mysql_query($requete) or die(mysql_error());
    while ($row = mysql_fetch_assoc($res, true)) {
        $items = explode(',',$row['deHotels']);
        array_push($items, $row);
    }
die(json_encode($items));

There is a screen of the result:
http://nsa29.casimages.com/img/2012/06/01/120601072406136633.jpg

Sorry for my english, im from quebec city.

Any one can help me to figure it out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:32:15+00:00Added an answer on June 4, 2026 at 7:32 pm

    Try this:

    while ($row = mysql_fetch_assoc($res, true)) {
      array_push($items, $row['deHotels']);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a pretty minor problem that I think can be resolved by re-thinking
I'm working on an MFC application, that got pretty messy over years and over
I've got an app that's working pretty flawlessly in Chrome and FF, however, when
I have to admit that I got pretty rusty with django, so I'm sorry
I've got a pretty form that loads on any page on the site to
I got pretty experienced with testing controllers, my question here is though, aren't we
I've got a pretty ordinary Java EE application running on JBOSS. It uses the
i've got a pretty simple .NET console application. I wish to pass in some
I've got a pretty substantial XLS file a client provided 830 total tabs/sheets. I've
I've got a pretty strange issue in my first try of using Entity Framework

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.