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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.