K
K
Kirill2016-02-12 23:48:21
PHP
Kirill, 2016-02-12 23:48:21

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>';
?>

perfectly renders the output from the database in the textarea, I need to make another output from the database in the input text, how?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
Taras Labiak, 2016-02-12
@kissarat

Ahhh... Maybe your specialty is an obfuscator?

T
ThunderCat, 2016-02-13
@ThunderCat

mmm, well at least he draws a conclusion ....

<?
$someText = $row['some_text'];
?>
<input type="text" value="<?=$someText;?>">

Where are you getting this code from? Do you follow him in a time machine in the 90s ???

Z
Zakhar Storozhuk, 2016-02-13
@Phell

<input value="сюда выводи переменную">

E
entermix, 2016-02-13
@entermix

You've duplicated your question 5 times already, but you still don't understand anything ..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question