Re: assign database result to iinput text box
| From: | Maciek Sokolewicz | Date: | Wed, 18 Sep 2013 11:45:32 +0000 |
| Subject: | Re: assign database result to iinput text box | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-322083@lists.php.net to get a copy of this message | ||
On 18-9-2013 7:33, iccsi wrote:
I have following html code to show my input text box and php to connect server and select result from database server. I would like to know how I can I use php to assign the value to my input text. Your help and information is great appreciated, Regards,Hi iccsi, first, look at http://www.php.net/mysql_fetch_array the example should help you. Once you have the value you're looking for in a variable, you simply assign insert it into the value property of your input element. Ie. you should have something like <input type="text" name="a" id="b" value="the variable containing your data"> Also please note that the mysql extension is deprecated; you are advised to switch to either PDO_MySQL or mysqli instead. - Tul