browser refreash?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

browser refreash?

Post by C_Calav »

hi guys,

i have a page called "summary.php" with a insert script at the start of it.

Code: Select all

<?php
$sql  = "INSERT INTO customer (C_ID, C_First, C_Last, C_Email, C_Phone, C_Address1, C_Address2, C_Country, C_City) VALUES ('$C_ID','$C_First','$C_Last','$C_Email','$C_Phone','$C_Address1','$C_Address2','$C_Country','$C_City')";
        $result = mysql_query($sql, $db) or die ("Execution failed."); 
?>

i also have a page called "update_summary.php" with a update script at the start of it.

Code: Select all

<?php
	$query = "UPDATE customer SET C_First='$ud_C_First',C_Last='$ud_C_Last',C_Email='$ud_C_Email',C_Phone='$ud_C_Phone',C_Address1='$ud_C_Address1',C_Address2='$ud_C_Address2',C_Country='$ud_C_Country',C_City='$ud_C_City' WHERE C_ID='$C_ID'";

    #execute SQL statement
	$result = mysql_query($query, $db) or die (mysql_error()."<br />Couldn't execute query: $query");
?>


now if i click refreash on the browser "update_summary.php" stays the same

but if i click refreash on on "summary.php" i get "Execution failed." on the page.

can anyone tell me why this is?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

try adding

die ("Execution failed. ". mysql_error()); ?>

as it will give you some more information as what the problem is
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

thanx Phenom will try that when i get home!
Post Reply