A
Anonymous
Guest
I hope someone out there can help me (being a newbie)
I am writing what is probably quite a simple website using mainly php, I have sorted being able to read all the information from the various databases, but I can't seem to get any form of manipulation to work,
below is a cut down version my manipulation code, has anyone got any ideas?
Thanks in advance
I am writing what is probably quite a simple website using mainly php, I have sorted being able to read all the information from the various databases, but I can't seem to get any form of manipulation to work,
below is a cut down version my manipulation code, has anyone got any ideas?
Code:
<?
if ($savecruise) {
$db = mysql_connect("localhost", "root", "homer");
mysql_select_db("Cruises",$db);
$sql = "UPDATE general SET Cruisenum=$cruisenum,PI=$pi,Institute=$institute,Location=$location, sailingport=$sailingport,completion=$completion, year=$year WHERE general.Cruisenum=$cruisenum";
$result = mysql_query($sql);
echo "Cruise Information Updated.\n";
$cruisepage = $cruisenum;
};
?>
<?
if ($deletebutton) {
$db = mysql_connect("localhost", "root", "homer");
mysql_select_db("Cruises",$db);
$sql = "DELETE FROM general WHERE Cruisenum=$cruisenum";
$result = mysql_query($sql);
echo "$sql Record deleted!";
};
?>
<?
if ($newbutton) {
$db = mysql_connect("localhost", "root", "homer");
mysql_select_db("Cruises",$db);
$sql = "INSERT INTO general (Cruisenum,PI,Institute,Location) VALUES ('$cruisenum','$pi','$institute','$location')";
$result = mysql_query($sql);
echo "New Cruise Entered\n";
};
?>