Issues with MSSQL
Posted: Fri Dec 08, 2006 5:31 pm
Hey guys...
I'm new to the forum but not new to PHP. I am, however, trying something I haven't done before, and that is to make a connection to MSSQL. I've done plenty of work with PHP and MySQL, so I'm not illiterate...
Here's some code I'm using to make my connection...
The "GetLastMonthsLeads" is a stored proc on dbdev/consumer.
I'm using PHP 4.something and this is on a W2K server. With the code above when I run it and look at the source this is what I get...
Which is telling me something is very wrong with my PHP install because it's not allowing all the html to go to source. If I move the echo"hello" line to another location after the first MSS command, it doesn't even echo.
OK... with all that in mind, could there be something missing with my php install? I do have the ODBC set up, for those who would ask. It seems to me that the password, username can't be the issue because even the DIE string isn't working. I've searched all over and am not finding much clarity on this issue. Any help would be appreciated.
Thanks.
I'm new to the forum but not new to PHP. I am, however, trying something I haven't done before, and that is to make a connection to MSSQL. I've done plenty of work with PHP and MySQL, so I'm not illiterate...
Here's some code I'm using to make my connection...
Code: Select all
<html>
<head>
</head>
<body>
<?php
echo"hello";
$query = "exec GetLastMonthsLeads";
MSSQL_CONNECT('dbdev','kleadreaderOAS','******')or die("Couldn't connect to the database!");
mssql_select_db('consumer')or die("Couldn't select to the database!");
$result = MSSQL_QUERY($query)or die("Couldn't query to the database!");
$resultamnt = MSSQL_NUM_ROWS($result)or die("Couldn't num the database!");
for($i=0;$i<$resultamnt;$i++){
$line = mssql_fetch_array($result);
echo $line[$i];
}
?>
</body>
</html>I'm using PHP 4.something and this is on a W2K server. With the code above when I run it and look at the source this is what I get...
Code: Select all
<html>
<head>
</head>
<body>
helloOK... with all that in mind, could there be something missing with my php install? I do have the ODBC set up, for those who would ask. It seems to me that the password, username can't be the issue because even the DIE string isn't working. I've searched all over and am not finding much clarity on this issue. Any help would be appreciated.
Thanks.