Thx chancer for the help...
I didn't try your solution, I found it myself...
It was stupid....
$result = mysql_query ($sql, $conn);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if (mysql_num_rows($result)>0) {
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
Anybody see the fault????
look carefully, it's so stupid, like always, something is shown 2 times...
there was the error, I fetch it 2 times... so second time the first record isn't collected anymore...
but, if anybody ever wants to use it, I will post the solution here
if you have questions, mail me and I will try to help...
<Script language="javascript">
function imageChange() {
picimage=document.createright.change_image.value;
document['picture'].src=picimage;
}
</script>
than, In the form :
<form name="createright" method="post" action="<?php echo($PHP_SELF) ?>">
<select name="change_image" onChange="imageChange()">
<option value="/php/pictures/0.jpg">=Leave blank=</option>
<?php
$test="/php/pictures/";
$sql = "SELECT * FROM tblImage ORDER BY ImageID ASC";
$result = mysql_query ($sql, $conn);
if (mysql_num_rows($result)>0) {
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$str1 .= "<"."option value=\"" . $test. $row["FileName"] . "\">". $row["ImageID"]. " : ".$row["ImageDescription"] . "</option>";
}
}
print $str1;
?>
</select>
<?php
$test="/php/pictures/";
print "<img src=\"".$test."0.jpg\" width=50 height=50 border=0 alt=\"\" name=\"picture\" align=\"absmiddle\">";
Basic is : you just get the id or filename from the table...put it in the drop down list
when selected, that value is the one selected, here the filename is the value
the onChange = >calls a javascript, and there you the value of the selected image from the list is passed to...
than the value is pointed to the image
and the image 'picture' is replaced by the value that is selected in the list...
mmmmh, If you can still follow?
if questions : PM me or mail me or ...
Thx chancer, I really appreceate your help...
Without you I would have taken me a lot longer so...
Respect !!!!