Trying Use Following Php Script Make Changes Database Script Database Connects Without Iss Q34185938

I am trying to use the following PHP script to make changes to adatabase from the script.
The database connects without issue, and can easily pullinformation from the database, however $insertSQL seems to beunable to make any changes to the database.

<?phpinclude ‘database_conn.php’;$recordID = isset($_REQUEST[‘recordID’]) ? $_REQUEST[‘recordID’] : null;$recordTitle =isset($_REQUEST[‘recordtitle’]) ? $_REQUEST[‘recordtitle’] : null;$recordYear =isset($_REQUEST[‘recordyear’]) ? $_REQUEST[‘recordyear’] : null;$recordPublisher =isset($_REQUEST[‘recordpublisher’]) ? $_REQUEST[‘recordpublisher’] : null;$recordCategory =isset($_REQUEST[‘recordcategory’]) ? $_REQUEST[‘eventstartdate’] : null;$recordPrice =isset($_REQUEST[‘recordprice’]) ? $_REQUEST[‘recordprice’] : null;//Alter table command for the database$insertSQL = “UPDATE `nmc_records` SET `recordTitle`=’$recordTitle’,`recordYear`=’$recordYear’,`pubID`=’$recordPublisher’,`catID`=’$recordCategory’,`recordPrice`=’$recordPrice’ WHERE `recordID`=’$recordID'”;//checks the query worksif (mysqli_query($dbConn, $insertSQL)){Event details edited successfully, details below: “; echo “

Record Title:

“; echo “

Record Year:

“; echo “

Record Publisher:

“; echo “

Record Category:

“; echo “

Record Price:

“; echo “

$recordTitle

“; echo “

$recordYear

“; echo “

$recordCategory

“; echo “

$recordPublisher

“; echo “

$recordPrice

“; } else { echo “Error: “.$insertSQL.”
“.mysqli_error($dbConn); } ?>

how can this code be fixed to allow it to make changes to thedatabase? (no errors are showing when the page runs)

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *