Hi,
I have a base that accepts data in and I can display all the data in a table :)

How do I make the database echo out to read only text box on a form one string at a time ?

do i have to do some .php before the <head> ?

<?php

        $connection = mysql_connect("localhost","bobby","passnum") or die ("Couldn't connect to server."); 
        $db = mysql_select_db('"tracy_isl"', $connection) or die ("Couldn't select database."); 

        $Key=$_POST['id'];
        $a1=$_POST['a1'];
        $a2=$_POST['a2'];
        $a3=$_POST['a3'];

        $data = "VAREBALES `tab1` SET a1='$Name', a2='$a2', a3='$a3' WHERE ID=".'"'.$Key.'"';
          $query = mysql_query($data) or die("Couldn't execute query. ". mysql_error());

        ?><HTML><HEAD><TITLE>boxes</TITLE><META name=GENERATOR content="MSHTML 10.00.8400.141"></HEAD><BODY>

<FORM style="BORDER-TOP-COLOR: ; BORDER-BOTTOM-COLOR: ; BORDER-RIGHT-COLOR: ; BORDER-LEFT-COLOR: " method=post action=next1.php>&nbsp;# 0000<INPUT value="Text Field">=id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -<INPUT size=22 value="Text Field" name=a3>=a3<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; about -<INPUT size=22 value="Text Field" name=a2>&nbsp;=a2</P><P align=center></P><P align=center>&nbsp;</P>
<P align=center>&lt;LAST &gt;<TEXTAREA style="HEIGHT: 116px; WIDTH: 656px" rows=1 cols=35 name=a4>Insert Text Here=a4</TEXTAREA>&lt;NEXT&gt;</P><P align=center>tag&nbsp; -<INPUT value="Text Field=a5" name=a5></P>
<P align=center>&nbsp;</P><P>
</P><P>&nbsp;</P></FORM>


 </BODY></HTML>

Thanks.

Member Avatar for LastMitch

How do I make the database echo out to read only text box on a form one string at a time ?

I think you need to Select the data first from the database or ajax the data.

Isn't it much easier if you SELECT and then echo out the data in the textbox.

You can used Heredoc syntax which is this:

http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

It looks like this:

echo <<< EOT

your data

EOT;

I didn't test it but it should look like this when you submit your form:

<form action="form.php" method="post">
<?php echo <<< EOT <TEXTAREA> your data </TEXTAREA> EOT; ?>
</from>

Base on your code the Heredoc syntax would work.

i don't have an idea.. i'm sorry..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.