Jump to content

PHP/MSSQL (page not loading)


wkid87

Recommended Posts

Hello, I'm new here and I hope you all are able to help me. I'm trying to connect to an SQL server via PHP but for some reason when I tried to load the file I'm getting page can not be found.

 

<?php
include 'adodb.inc.php';
?>
<html>
<head>
<?php
function test_insert()
{	
$con = mssql_connect('','','');
mssql_select_db('', $con);
$sql = "insert into [eduusers] ([user],[pwd],[lvl],[sess],[fname],[lname],[email]) values 
		('username','password','1','sess','fname','lname','email')";
$res = mssql_query($sql,$con);
if (!$res) 
{
	$txt = "SQL statement failed with error:<br />";
	$txt .= mssql_get_last_message()."<br />");
} 
else 
{
	$txt = "One data row inserted:<br />";
	$txt .= $sql."<br />";
}  
mssql_close($con); 
return($txt);
}
?>
</head>
<body>
Hello World: testing insert:<br />
<?php
echo (test_insert());
?>
</body>
</html>




Link to comment
https://forums.phpfreaks.com/topic/179064-phpmssql-page-not-loading/
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.