/    Sign up×
Community /Pin to ProfileBookmark

Known issues – SQL 2005/IIS/PHP

Hello all. I have finally reached the end of my first php project and am ready to move it to the production server. The test server is MS SQL 2003/Apache/PHP whereas the production server is MS SQL 2005/IIS/PHP.

I created a test db and am running the following page to hit it.

<html>
<head>
</head>
<body bgcolor=’yellow’>

<?php

echo “Hello world1<br>”;

$handle = mssql_pconnect (“XXX.XXX.XXX.XXX”, “username”, “password”);
mssql_select_db (“ittest”, $handle);
$recordset = mssql_query (“select * from Employee”, $handle);
while($arr = mssql_fetch_row($recordset))
{
echo “Hello world2<br>”;
echo “$arr[0]<br>”;
}

?>

</body>
</html>

When I hit this page, I get Hello world1, but nothing from the db shows (including Hello world2). Now the server is not my problem, that is the admins job. My question is simple, from the dev standpoint, do I need to make any changes to my code for the move from sql ’03 to ’05?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@chazzyFeb 03.2006 — seeing as how it's not throwing any errors back to you, i might guess that the table doesn't have any data.

What about if you add the num_rows function. maybe without doing the while just do [code=php]echo mssql_num_rows($handle);[/code]
Copy linkTweet thisAlerts:
@Doc_ThirstauthorFeb 03.2006 — Same story, get the Hello world1, but that's it. There are only 3 records in the table, trying to keep it simple until I get it strait.

I don't think I'm missing anything in the db call. It has to be a serverside issue.
Copy linkTweet thisAlerts:
@chazzyFeb 03.2006 — Why didn't they do a datasource in IIS? Then you can use PHP to call from the data source. Anyways, did you try putting up a phpinfo file on both dev and prod verify that everything's installed the same on PHP.

Either way, not a good idea to use different techs on dev and prod, in general, but gotta do what ya gotta do.
Copy linkTweet thisAlerts:
@Doc_ThirstauthorFeb 03.2006 — I couldn't agree more. I wish I had more control over the equipment I develop on. Comparing the phpinfo's is a great idea, thanks man!
×

Success!

Help @Doc_Thirst spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...