MsSQL / PHP Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phillbooth
Forum Newbie
Posts: 2
Joined: Fri Nov 13, 2009 6:54 am

MsSQL / PHP Problem

Post by phillbooth »

Hi there,

I have MsSQL running on a php file, for some weird reason I just cant seem to connect to the table called Properties, though using exactly the same code I can connect to any other table in the database. Please help!

Code: Select all

mssql_connect($host_featured_property, $username_featured_property, $password_featured_property);
 
mssql_select_db($db1);
 
$result1 = mssql_query("SELECT * FROM Properties"); <-- code breaks here
 
while ( $record1 = mssql_fetch_array($result1) )
{
$featured_property = $record1["PropertyID"];
echo $featured_property; 
}
I have sat down with my manager and we both agree its the table not the code does anyone have any insite?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: MsSQL / PHP Problem

Post by papa »

Sounds like the table yes.

Any difference between the tables except for columns?
phillbooth
Forum Newbie
Posts: 2
Joined: Fri Nov 13, 2009 6:54 am

Re: MsSQL / PHP Problem

Post by phillbooth »

Actualy, your question gave me an idea... I changed the * for the columns required and it worked! Strange hu!
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: MsSQL / PHP Problem

Post by papa »

Nice :D
Post Reply