show data on the text input box

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux