mssql not a valid ss_sqlsrv_stmt resource

It happen when i have a code like below

function connect()
{
return sqlsrv_connect(..);
}
..
$result = sqlsrv_query(connect(), $sql);

The error mysteriously went away when i change the code to this

$connect = connect();
$result = sqlsrv_query($connec, $sql);

Advertisements

Published by

paragasu

Different. In a good way

2 thoughts on “mssql not a valid ss_sqlsrv_stmt resource”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s