Note that there are some explanatory texts on larger screens.

plurals
  1. PONot returning selected pciture name
    text
    copied!<p>I have a database with pictures that i can delete from or use them in different parts of the the website by choosing one of the radio buttons in the popup.Problem is everytime I click I click on a picture the name of the first picture in the database comes up not the one from the picture i clicked . What's wrong? I used PHP 5.3 and HeidiSQL </p> <pre><code>&lt;?php // ... $result=mysql_query("SELECT * FROM imagini WHERE menu_id=6"); while($data=mysql_fetch_row($result)){ ?&gt; &lt;div class="tag"&gt; &lt;div id='container_poze_originale'&gt; &lt;a href="javascript:show_popup('my_popup')" class="buton"&gt;Alege alt rol &lt;/a&gt; &lt;div id="my_popup" style="display:none;border:1px dotted gray;padding:.3em;background-color:white;position:absolute;width:auto;left:100px;top:100px"&gt; &lt;a href="javascript:hide_popup('my_popup')"&gt;close&lt;/a&gt; &lt;form action="popup.php" method="post" &gt; &lt;input type="text" name="alt-rol" value="&lt;?php echo $data[1];?&gt;" /&gt; //always returns the name of the first picture in the database not the one i select &lt;input type="submit" value="Adauga imagine" class="buton_imagine" /&gt; &lt;div class="radio"&gt; &lt;input type="radio" name="tip_imagine" value="0"/&gt;&lt;label for="tip_imagine" class="radio2"&gt;Logo&lt;/label&gt; &lt;input type="radio" name="tip_imagine" value="1"/&gt;&lt;label for="tip_imagine" class="radio2"&gt;Slider&lt;/label&gt; &lt;input type="radio" name="tip_imagine" value="2"/&gt;&lt;label for="tip_imagine" class="radio2"&gt;Hot destinations&lt;/label&gt; &lt;input type="radio" name="tip_imagine" value="3"/&gt;&lt;label for="tip_imagine" class="radio2"&gt;Pachete&lt;/label&gt; &lt;input type="radio" name="tip_imagine" value="4"/&gt;&lt;label for="tip_imagine" class="radio2"&gt;Reclama&lt;/label&gt; &lt;input type="radio" name="tip_imagine" value="5"/&gt;&lt;label for="tip_imagine" class="radio2"&gt;Background&lt;/label&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;div class="imagine_originala"&gt; &lt;img src= "../upload/original/&lt;?php echo $data[1];?&gt;" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;div class="Btag" style="display:none;"&gt; &lt;div id="buton_slide4" &gt; &lt;a href="delete.php?id_imagini=&lt;?php echo $data[0];?&gt;&amp;nume_imagini=&lt;?php echo $data[1]?&gt;&amp;id_menu=&lt;?php echo $data[2]; ?&gt;" class="buton"&gt;Sterge&lt;/a&gt;&lt;/td&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload