Good day all,
I've got a code that reads the users from a database and puts them in a dropdown menu:
<?php
mysql_connect('', '', '');
mysql_select_db ("");
$sql = "SELECT id,name FROM jos_users";
$result = mysql_query($sql);
echo "<select name='deelnemers' onchange='copyId2textinput(this);'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['id'] . "'>" . $row['name'] . "</option>";
}
echo "</select>";
?>
Now i've got another database called jos_comprofiler with also an ID and also a avatar (image).
I was wondering if somebody give me some advise to compare the ID's from the 2 tables and then show the picture.
So for example, if i click on a user in the dropdown, it must look if there's a ID match with the other table, and if there is, show the picture from 'avatar'.
Thank you for your help and excuse me for my bad english!