Answer the question
In order to leave comments, you need to log in
How to make an output from the database in input?
Hello! There is a code:
<?php
echo '<form action="update_main2.php" name="forma23" method="post">';
//<div id="text" style="display:none; position: relative;">Название<br><input style="position: absolute;" type="text" name="main_nazv" id="main_nazv" size=30><br><br><br>';
$db = mysql_connect('localhost', 'webrazm1_test', '901kiril') or die(mysql_error());
mysql_select_db('webrazm1_test',$db) or die('Could not select database:'.mysql_error());
$result=mysql_query("SELECT * FROM `main_textfoto`") or die(mysql_error());
echo '<div id=textfoto style=display:none; position: relative;>Название<br><input type=text name="maintextfoto_nazv" id="maintextfoto_nazv"><br>';
echo '<textarea name="maintextfoto_text" id="maintextfoto_text" cols=37 rows=5>';
while($row=mysql_fetch_array($result))
{
echo $row['maintextfoto_text'];
}
echo '</textarea>';
echo '<input type=hidden name=MAX_FILE_SIZE value=30000000 />
<input type=file name=foto10 id=foto10>';
mysql_close($db) or die('Could not close connection');
echo '<br><br><input type="submit" class="button100" id="click" onclick="saveF()" value="Сохранить"></div><br>
</form>';
?>
Answer the question
In order to leave comments, you need to log in
mmm, well at least he draws a conclusion ....
<?
$someText = $row['some_text'];
?>
<input type="text" value="<?=$someText;?>">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question