krepepet Posted June 11, 2009 Share Posted June 11, 2009 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 More sharing options...
haku Posted June 11, 2009 Share Posted June 11, 2009 It would help if you were a little more vague about why it's not working. Link to comment https://forums.phpfreaks.com/topic/161753-solved-same-coding-not-working/#findComment-853439 Share on other sites More sharing options...
krepepet Posted June 11, 2009 Author Share Posted June 11, 2009 the first code is working, the data from table "closed" can be udpated..while for the second one, the data from table "closednf" cant be updated..i also have 4 more tables..it works fine but only for the table closednf it stucks.. Link to comment https://forums.phpfreaks.com/topic/161753-solved-same-coding-not-working/#findComment-853470 Share on other sites More sharing options...
haku Posted June 11, 2009 Share Posted June 11, 2009 Change this: $result2=mysql_query($query2); to this $result2=mysql_query($query2) or die(msyql_error() . '<br>' . $query2); and show us what it says. Link to comment https://forums.phpfreaks.com/topic/161753-solved-same-coding-not-working/#findComment-853476 Share on other sites More sharing options...
krepepet Posted June 11, 2009 Author Share Posted June 11, 2009 Fatal error: Call to undefined function msyql_error() out of idea..already rebuilt the code in case i overlook any misspelled..still the same.. -the table closednf not updated -it doesnt show any error.. Link to comment https://forums.phpfreaks.com/topic/161753-solved-same-coding-not-working/#findComment-853498 Share on other sites More sharing options...
haku Posted June 11, 2009 Share Posted June 11, 2009 Typo on my part - should have been mysql_error() Try it again. Link to comment https://forums.phpfreaks.com/topic/161753-solved-same-coding-not-working/#findComment-853501 Share on other sites More sharing options...
krepepet Posted June 11, 2009 Author Share Posted June 11, 2009 still the same.. Link to comment https://forums.phpfreaks.com/topic/161753-solved-same-coding-not-working/#findComment-853515 Share on other sites More sharing options...
haku Posted June 11, 2009 Share Posted June 11, 2009 Then you didn't change my typo. Link to comment https://forums.phpfreaks.com/topic/161753-solved-same-coding-not-working/#findComment-853521 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.