[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

mysql to sql server 2005

what is this in sql server 2005

while ($row = mysql_fetch_array($result)){  
0
rgb192
Asked:
rgb192
3 Solutions
 
Reza RadCommented:
>>while ($row = mysql_fetch_array($result)){
this is not mysql, this is php working with mysql
If you want to connect to mssql from php, so you can use mssql functions in php:
http://ir.php.net/manual/en/ref.mssql.php
this is specially form mssql_fetch_array instead of mysql_fetch_array:
http://ir.php.net/manual/en/function.mssql-fetch-array.php


0
 
leakim971PluritechnicianCommented:
This is a loop to get all result from a previous query. All results is put in the variable $result.

At each loop you put a row from $result in the $row variable.

In the loop you read field like this : $row['field_name'] or $row[0] for the first field in a row.

0
 
Ray PaseurCommented:
Instead of this:
while ($row = mysql_fetch_array($result)){  

You probably want this:
while ($row = mssql_fetch_array($result)){  

It looks to me like there is a one-to-one correlation between the MySQL and this MSSQL function.  THe man pages aer very similar for these.

"mssql_fetch_array() is an extended version of mssql_fetch_row(). In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys. "
0
 
rgb192Author Commented:
thanks
0
 
leakim971PluritechnicianCommented:
Big big up!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now