You are here: Need help with modifying values « PHP « IT news, forums, messages
Need help with modifying values

Posted by "Anasta" on 12/18/05 10:21

The first script works ' modify_values.php' showing the values and a modify
link next to each but the next script it parses to 'modify_values2.php' is
obviously not working. I have tried to modify it from another script and
cant get it to pass the correct variables-- it always shows the first row in
the database . Any help appreciated.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
modify_values.php

<?php
include("connect.php");
$sql = "Select * from leaderboard";
$result = mysql_query($sql);
?>
<br>
<br>

<body bgcolor="#FFFFFF" text="#666666" link="#666666">


<table width="461" border="1" align="center" cellpadding="2" cellspacing="0"
bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td width="206" height="25" align="center" bordercolor="#FFFFFF" ><div
align="left"><b>Title</b></div></td>
<td width="165" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div
align="left"><b>Rating</b></div></td>
<td width="70" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF"></td>

</tr>
<?php
while ($myrow = mysql_fetch_array($result)) {

echo "<tr><td>" . $myrow['Name'] . "</td>";
echo "<td>" . $myrow['Rating'] . "</td>";
echo "<td bgcolor='cyan'> <a href='modify_values2.php?id=" . $myrow['ID'] .
"'>Modify</a></td></tr>";
}
?>
</table>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



modify_values2.php

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


<?php
include("connect.php");



$sql = "Select * from leaderboard ";
$result = mysql_query($sql);

$myrow = mysql_fetch_array($result);

$Name = $myrow['Name'];
$Rating = $myrow['Rating'];

?>
<form name="form1" method="POST" action="update_values.php">

<center>
<table border="1">
<tr>
<td><b>Title</b></td>
<td> <INPUT TYPE=TEXT SIZE="50" NAME="Name" VALUE="<?php echo
$Name;?>">
</td>
</tr>
<tr>
<td><b>Rating</b></td>
<td> <INPUT TYPE=TEXT SIZE="50" NAME="Rating" VALUE="<?php echo
$Rating;?>">
</td>
</tr>
</table>
</center>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<br><center><input type="submit" name="Update" value="Update"> &nbsp; <input
type="submit" name="Delete" value="Delete"></center>
</form>
</body>
</html>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация