The first thing to do is check what $arr contains by doing a print_r($arr); after the mssql_fetch_ array() statement. This will contain newlines instead of <BR> characters, so view source might give you a better view of what you got from the DB. Good luck -jmb ankit.mathur82 wrote: > > Hi friends, > > I'm beginning to learn php. > > While doing so I was now in the process of connecting my pages to MS > SQL & retrieve data & display it to the user. > > However, I'm as of now stuck with a simple select query itself. > > While the query is being processed I'm unable to store it in a array > n display the result on screen. > > Here's the part of the page I've developed ------- > > <?php > > include("conn.php"); > > $sql="select ratesheetid, ratesheetname from usr_ratesheet"; > > $result=mssql_query($sql) or die("ERROR IN Executing Query"); > > $num=mssql_num_rows($result); > > $arr=mssql_fetch_array($result,MSSQL_ASSOC)or die("ERROR IN Getting > Data"); > > $ratesheetid=$arr['RateSheetId']; > $ratesheetname=$arr['RateSheetName']; > ?> > > Here conn.php contains all my database connection info & is working > perfectly fine. So the connection is established & query processed. > > I just want to know the code to display the result on screen. > > Thanks everybody in advance for helping me out & I would appreciate > if you could reply back to me at the earliest as then I'd be able to > move forward in my quest to learn this wonderful language & use it in > my work. > > Thanks again > Ankit Mathur > >