Jump to content

[SOLVED] Same coding not working


krepepet

Recommended Posts

Are there any known issue about this?

 

I have few pages with the exact same code, the only difference is the table name. I just copy paste the coding from the first page and change the table name but unfortunately one of them is not working at all. The page is about updating data..

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>FIP DBMS</title>

 

<h2>FIP Project Closed</h2>

</head>

 

<body>

 

<?php

ini_set('display_errors', 1);

ini_set('error_reporting', E_ALL | E_STRICT);

 

$dbhost = 'localhost';

$dbuser = 'root';

$dbpass = '';

$dbname = 'fip';

 

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to database');

$dbselect = mysql_select_db($dbname, $conn);

 

$id = $_GET['id'];

 

$no = $_POST['no'];

$location = $_POST['location'];

$fipno = $_POST['fipno'];

$title = $_POST['title'];

$eic = $_POST['eic'];

$registered = $_POST['registered'];

$present = $_POST['present'];

$remarks = $_POST['remarks'];

$close = $_POST['close'];

 

$query2="UPDATE closed SET

no=$no, location='$location', fipno='$fipno', title='$title', eic='$eic',

registered='$registered', present='$present', remarks='$remarks', close='$close'

WHERE fipno='$id'";

$result2=mysql_query($query2);

 

echo "1 record updated";

$dbclose = mysql_close($conn);

?>

 

 

<form name="Home" action="closed.php" method="get">

<input type="submit" value="Back" />

 

</form>

</body>

</html>[/Quote]

 

its working..

 

and this one is not..

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>FIP DBMS</title>

 

<h2>FIP Project Closed - Not Feasible</h2>

</head>

 

<body>

 

<?php

ini_set('display_errors', 1);

ini_set('error_reporting', E_ALL | E_STRICT);

 

$dbhost = 'localhost';

$dbuser = 'root';

$dbpass = '';

$dbname = 'fip';

 

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to database');

$dbselect = mysql_select_db($dbname, $conn);

 

$id = $_GET['id'];

 

$no = $_POST['no'];

$location = $_POST['location'];

$fipno = $_POST['fipno'];

$title = $_POST['title'];

$eic = $_POST['eic'];

$registered = $_POST['registered'];

$present = $_POST['present'];

$remarks = $_POST['remarks'];

$close = $_POST['close'];

 

$query2="UPDATE closednf SET

no=$no, location='$location', fipno='$fipno', title='$title', eic='$eic',

registered='$registered', present='$present', remarks='$remarks', close='$close'

WHERE fipno='$id'";

$result2=mysql_query($query2);

 

echo "1 record updated";

$dbclose = mysql_close($conn);

?>

 

 

<form name="Home" action="closednf.php" method="get">

<input type="submit" value="Back" />

 

</form>

</body>

</html>[/Quote]

 

any idea why?

Link to comment
https://forums.phpfreaks.com/topic/161753-solved-same-coding-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.