php code for displaying data from mysql into textbox?
Posted by: cool_KK (60.51.135.---)
Date: February 10, 2006 10:05AM

Is anyone out there know what is the php code for displaying data from mysql into textbox......? I try to do shopping cart sample yet due to i am beginner, i don't quite understand sample of shopping cart available from Internet.

For my shopping cart, my ideas is to create one temporary table database (mysql) and one permanent table database (mysql). Below are the codes:
-----------------------------------------------------------------------------------------
<html>
<head>
<title>Untitled Document</title>
</head>

<body>
<p align="center"><img src="../../../Documents%20and%20Settings/All%20Users/Documents/My%20Pictures/Sample%20Pictures/Winter.jpg" width="478" height="290">
</p>
<form name="form1" method="post" action="tempcart.php">
<p>&nbsp;</p>
<p>code:
<input name="code" type="text" id="code" value="100000" readonly="true">
</p>
<p> price:$
<input name="price" type="text" id="price2" value="100" readonly="true">
</p>
<p>
<input type="submit" name="Submit" value="Add to Cart">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="bead.html">&nbsp;<strong>Back</strong></a></p>
<p>View Cart</p>
<p>&nbsp;</p>
</form>
<p align="center">&nbsp;</p>
<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;</p>
</body>
</html>
------------------------------------------------------------------------------/* From fixed textbox value, i save the value to temporary table database after i click the button.

------------------------------------------------------------------------------

<?php
$user='root';
$pass='admin';
$db='fhsb';

$code=$_POST['code'];
$price=$_POST['price'];
$Total=$price;

mysql_connect(localhost,$user,$pass) or die("cannot connect to database."winking smiley;
mysql_select_db($db) or die("cannot select database."winking smiley;
$query="INSERT INTO tbltemporder VALUES('$code','$price','1','$Total')";
mysql_query($query) or die("cannot execute query"winking smiley;

mysql_close();

header('Location:bead.html');

?>
-------------------------------------------------------------/* code to save value to temporary mysql.

I want to create php code for display the value of temporary mysql into textbox. where in this textbox, the user can view the value of table before confirming the purchases.

Is anyone can help me?

Options: ReplyQuote
Re: php code for displaying data from mysql into textbox?
Posted by: Robert (---.eburwd3.vic.optusnet.com.au)
Date: February 10, 2006 10:56AM

I would think you are more likely to get help for this from a php script site.
This site is just about WAMP related problems.

Options: ReplyQuote


Sorry, only registered users may post in this forum.