show data on the text input box

From: Date: Fri, 09 May 2014 04:37:41 +0000
Subject: show data on the text input box
Groups: php.general 
Request: Send a blank email to php-general+get-323247@lists.php.net to get a copy of this message
I have following code to connect MySQL and database. I see 'connected to database', I would like to know that which code do I need to show my data on the text box? Your help and information is great appreciated, Regards, Iccsi, <?php /*** mysql hostname ***/ $hostname = 'MyHost'; /*** mysql username ***/ $username = 'MyUser'; /*** mysql password ***/ $password = 'password'; try { $dbh = new PDO("mysql:host=$hostname;dbname=iccsimd", $username, $password);
    /*** echo a message saying we have connected ***/
echo 'Connected to database';
    }
catch(PDOException $e) { echo $e->getMessage();
    }
$result = mysql_query("SELECT invid, invdate, note, amount FROM invheader"); //fetch tha data from the database while ($row = mysql_fetch_array($result)) { echo "ID:".$row{'invid'}." Inv Date:".$row{'invdate'}."Note: ". //display the results $row{'Note'}."<br>"; } //close the connection mysql_close($dbh); ?><br /> <body> <table width="200" border="1"> <tr> <td><input name="mytext" type="text" /></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr>

« previous php.general (#323247) next »