database value to post

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 7
Joined: Fri May 17, 2013 3:07 am

Sat Oct 26, 2013 9:59 am

Hi all,

I have a problem. At first ... I read a values into a form, method post, like this ...

Code: Select all

$row = mysql_query("SELECT MID(nazov,1,1) AS nazov FROM book GROUP BY MID(nazov,1,1)");

while ( $db = mysql_fetch_assoc($row) ) 
print "<form id=myForm method=post action=blablabla>";
print "<input type=text name=id value=".$db['nazov'].">";
print "</form>";
print "<a href=\"#\" onclick=\"myForm.submit()\" >".$db['nazov']."</a>";
but when I try to read a $_POST['id'] value on page blablabla .... it loads me always the first value of table .... and i dont know why ..... can you help me?

php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Oct 28, 2013 12:37 am

make sure you have the right query....make sure the query is picking the data that you want and then debug to see why $_POST is behaving in an odd manner.

Post Reply