•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,974 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,766 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2311 | Replies: 4 | Solved
![]() |
•
•
Join Date: Nov 2007
Posts: 183
Reputation:
Rep Power: 2
Solved Threads: 5
hi,
i have three pages.In the third page....i want the textbox to get the data base content in it but it is not working..i tried <input type="text" id="name" value="<? echo $line['0']; ?>"> but it is not working for me.i want to know wants wrong with my code
1st page
<?php
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$result=mysql_query("SELECT name FROM hi");
print "name";
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$line = mysql_fetch_row($result);
rint "<a href='king.php?name=".$line[0]."'>".$line[0]."";
}
mysql_close($link);
?>
2nd page
<?php
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$line = $_GET['name'];
echo "<table width='50%' border='1'>";
$result=mysql_query("SELECT * FROM hi where name='$line'");
for ($i = 0; $i < 1; ++$i)
{ $line = mysql_fetch_row($result);
print "Name $line[0]";
}
echo "</table>";
mysql_close($link);
?>
<form method="post" action="red11.php">
<input type="button" name="edit" value="edit">
</form>
3rd page
<?php
$hostname = "localhost";
$username = "splendor_lydia";
$password = "jesus";
$dbid = "splendor_samp";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$line = $_GET['name'];
$result=mysql_query("SELECT name,age FROM hi where name=$line ");
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$line = mysql_fetch_row($result);
print " Name $line[0] ";
}
mysql_close($link);
?>
i have three pages.In the third page....i want the textbox to get the data base content in it but it is not working..i tried <input type="text" id="name" value="<? echo $line['0']; ?>"> but it is not working for me.i want to know wants wrong with my code
1st page
<?php
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$result=mysql_query("SELECT name FROM hi");
print "name";
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$line = mysql_fetch_row($result);
rint "<a href='king.php?name=".$line[0]."'>".$line[0]."";
}
mysql_close($link);
?>
2nd page
<?php
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$line = $_GET['name'];
echo "<table width='50%' border='1'>";
$result=mysql_query("SELECT * FROM hi where name='$line'");
for ($i = 0; $i < 1; ++$i)
{ $line = mysql_fetch_row($result);
print "Name $line[0]";
}
echo "</table>";
mysql_close($link);
?>
<form method="post" action="red11.php">
<input type="button" name="edit" value="edit">
</form>
3rd page
<?php
$hostname = "localhost";
$username = "splendor_lydia";
$password = "jesus";
$dbid = "splendor_samp";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$line = $_GET['name'];
$result=mysql_query("SELECT name,age FROM hi where name=$line ");
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$line = mysql_fetch_row($result);
print " Name $line[0] ";
}
mysql_close($link);
?>
On page 2,
This wont pass to page 3 unless it's between <form> and </form> though.
php Syntax (Toggle Plain Text)
print 'Name: <input type="text" name="name" value="'.$line[0].'" />';
Last edited by buddylee17 : Nov 27th, 2007 at 10:51 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Please Very Important:How to Check with Database Values (JSP)
- inserting variable value into fields in access? (Visual Basic 4 / 5 / 6)
- assing table values to an array (JSP)
- help for auto complete text box (ASP.NET)
- Convert database values into Dropdown List (PHP)
- jsp code for values from database to textbox (JSP)
- Unable to insert form data into a database (ASP)
Other Threads in the PHP Forum
- Previous Thread: Public_html question?
- Next Thread: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource


Linear Mode