Link to home
Start Free TrialLog in
Avatar of danz67
danz67Flag for Italy

asked on

JQuery Mobile - Select Menu From MySql Table

Hi,

I take the data from a table and display it in a select menu component, I tried the code below but I get only blank lines worthless.
Is there any example or you can fix my code?
Thank you all,
Regard

			<select name="cliente" id="cliente" class="select" data-inline="false" data-native-menu="false">
			<option>Seleziona Cliente</option>
			<?php
                        $query = mysql_query("SELECT * FROM clienti ORDER BY RagioneSociale desc");
                        while($data = mysql_fetch_assoc($query)) {
                        ?>
                        <option value="<?php echo $data["RagioneSociale"]; ?>><?php echo $data["RagioneSociale"]; ?>"</option>
                        <?php } ?>
			</select>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Pratima
Pratima
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it may depend on what the data is in the $data array, is it a string or an integer?

try replacing:

echo $data["RagioneSociale"]

with

echo gettype($data["RagioneSociale"]);

also are you sure there is data in the array?
Avatar of danz67

ASKER

Best Solution for me