0

hi i'm a newbie in php, plz help me with this.
how can i put the value of my database to a textbox?
can u give me a sample code..
thx...

6
Contributors
9
Replies
23
Views
9 Years
Discussion Span
Last Post by Persi
0

http://www.w3schools.com/php/php_mysql_select.asp Check this. Instead of echoing $row and $row in the example, assign it to a variable and use it as the 'value' of the textbox. <input type="text" name="firstname" value="<?php echo $firstname; ?>">

thx nav33n. but how about textboxes inside a <?php ?> tags? do i have to echo <input type="text" name="firstname" value="<?php echo $firstname; ?>"> ?

0

textbox inside <?php tags ? Yep, you have to echo it. But this way. echo "<input type=\"text\" name=\"name\" value=\"$firstname\">";

0

Or u can write as

echo "<input type='text' name='name' value='$firstname'>";
0

if i insert data into text box how can i retive that data via combo box using php

0

<input type="text" name="name" value=<?php echo $name; ?>><br/> hear it is the php code but i can't access full name it only print the first part of the name can u help me pls? but i can access full name from $name in outside the input label

0

how to insert paging into a php script, and how it is worked and how can we insert values to pages

Edited by sebin george: n/a

0

<input type="text" name="name" value=<?php echo $name; ?>><br/> hear it is the php code but i can't access full name it only print the first part of the name can u help me pls? but i can access full name from $name in outside the input label

While displaying the data from the database on a text box, I can access only the first part of the name. You had the same problem it seems. Did you find any solution for that? I need to access the whole data.
This is the code i've used echo "<tr><td>Reg.No.:</td><td width='200'><input type='text' name='reg' value=".$row[RegNo]."></td></tr>";

Edited by Persi: n/a

0

textbox inside <?php tags ? Yep, you have to echo it. But this way. echo "<input type=\"text\" name=\"name\" value=\"$firstname\">";

While displaying the data from the database on a text box, I can access only the first part of the name. For example, if the name is 'Five Star', only the name 'Five' is displayed. Can you help in this? I'm just a beginner.
This is the code i've used echo "<tr><td>Reg.No.:</td><td width='200'><input type='text' name='reg' value=".$row[RegNo]."></td></tr>";

Edited by Persi: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.