Currently trying to add a record into my database using a html for into php. I've got the posting working from the form into the php I've tested this with a string. However I just can't seem to get my database connection down correctly.
//This bit is working
$reportedby = $_POST['reportedBy'];
$location = $_POST['loc'];
$desc = $_POST['desc'];
$link = mssql_connect("host", "user*", "pw", "db");
// insert
$sql = "INSERT INTO maintapp (reportedby, loc, brief) VALUES ('$reportedby', '$location', '$desc')";
mssql_query($link, $sql)
// Close connection
mssql_close($link);
?>
Error_Log
[05-Jan-2022 10:43:18 America/Boise] PHP Fatal error: Uncaught Error: Call to undefined function mssql_connect() in /home1/jcodecou/public_html/jwebdesign/maintapp/upload.php:9
Stack trace:
#0 {main}
thrown in /home1/jcodecou/public_html/jwebdesign/maintapp/upload.php on line 9
source https://stackoverflow.com/questions/70597368/php-mssql-insert-into-database
Comments
Post a Comment