Hi folks, can you help me out here? Below are two pages, when i click submit on index_admin.php i get the message Update sucseful (or something like that…) but it dosent acctualy update the DB itself… Fet
index_admin
[code=php]
<?
require ‘db_connect.php’;
$query=”SELECT * FROM Front_Page WHERE ID=’$ID'”;
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$Nav_Bar=mysql_result($result,$i,”Nav_Bar”);
$Next_Meeting=mysql_result($result,$i,”Next_Meeting”);
$Next_Meeting_Text=mysql_result($result,$i,”Next_Meeting_Text”);
$Program_Title=mysql_result($result,$i,”Program_Title”);
$Program_Text=mysql_result($result,$i,”Program_Text”);
$Iceland_Title=mysql_result($result,$i,”Iceland_Title”);
$Iceland_Text=mysql_result($result,$i,”Iceland_Text”);
$Images_Title=mysql_result($result,$i,”Images_Title”);
$Images=mysql_result($result,$i,”Images”);
?>
<form action=”update.php”>
<input type=”hidden” name=”UD_ID” value=”<?php echo ($ID) ?>” />
<input name=”Nav_Bar” type=”text” value=”<?php echo htmlentities($Nav_Bar) ?>” />
<input name=”Next_Meeting” type=”text” value=”<?php echo htmlentities($Next_Meeting) ?>” />
<input name=”Next_Meeting_Text” type=”text” value=”<?php echo htmlentities($Next_Meeting_Text) ?>” />
<input name=”Program_Title” type=”text” value=”<?php echo htmlentities($Program_Title) ?>” />
<input name=”Program_Text” type=”text” value=”<?php echo htmlentities($Program_Text) ?>” />
<input name=”Iceland_Title” type=”text” value=”<?php echo htmlentities($Iceland_Title) ?>” />
<input name=”Iceland_Text” type=”text” value=”<?php echo htmlentities($Iceland_Text) ?>” />
<input name=”Images_Title” type=”text” value=”<?php echo htmlentities($Images_Title) ?>” />
<input name=”Images” type=”text” value=”<?php echo htmlentities($Images) ?>” />
<input type=”Submit” value=”update”>
</form>
<?
++$i;
}
?>
update.php
[code=php]
<?php
$hostname=”localhost”;
$username=”comp”;
$password=”hiy”;
$database=”n”;
// Connect to the database
mysql_CONNECT($hostname, $username, $password) OR die(mysql_error());
@mysql_SELECT_DB(“$database”) OR die(mysql_error());
// Ask the database for the information from the links table
$query=”UPDATE Front_Page SET
Nav_Bar = `$Nav_Bar`,
Next_Meeting = `$Next_Meeting`,
Next_Meeting_Text = `$Next_Meeting_Text`,
Program_Title = `$Program_Title`,
Program_Text = `$Progam_Text`,
Iceland_Title = `$Iceland_Title`,
Iceland_Text = `$Iceland_Text`,
Images_Title = `$Images_Title`,
Images = `$Images`;
WHERE
ID=’ID'”;
@mysql_select_db($database) or die(mysql_error());
mysql_query($query) or die(mysql_error());
echo “Record updated”;
mysql_close();
?>
[/code]