List:General Discussion« Previous MessageNext Message »
From:Charles Brown Date:May 3 2012 8:26pm
Subject:Re: mixing and matching mysql & mssql whileloop within an if case
View as plain text  

Sent from my iPhone

On May 3, 2012, at 1:02 PM, "Haluk Karamete" <halukkaramete@stripped> wrote:

> Please take a look at the following code and tell me if there is a way
> around it.
> 
> if ($current_server_is_mysql):
>    while ($row = mysql_fetch_assoc($RS)) {
> else:
>    while( $row = sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC)){
> endif:
> Depending on the server I'm working with, I'd like to compile my
> records into the $RS recordset the proper/native way. If I can get
> pass this part, the rest should be all right cause both mysql and
> mssql $row can be tapped into the same way. For example,
> $row['fieldname'] will give me the field value whether the row was a
> mysql or mssql resource. So it all boils down to the above snippet
> failing.
> 
> The error I get points to the else: part in the above snippet.
> 
> Parse error: syntax error, unexpected T_ELSE in
> D:\Hosting\5291100\html\blueprint\pages\populate_migration_table.php
> on line 415
> I can understand why I am getting this error.
> 
> But, I'm hoping you guys can offer a work-around it without me
> resorting to duplicate the entire while loop she-bang.
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
> 
********************************************
This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.
********************************************
Thread
mixing and matching mysql & mssql whileloop within an if caseHaluk Karamete3 May
  • RE: mixing and matching mysql & mssql whileloop within an if caseRick James3 May
  • Re: mixing and matching mysql & mssql whileloop within an if caseCharles Brown3 May
  • Re: mixing and matching mysql & mssql whileloop within an if caseBaron Schwartz3 May
    • Re: mixing and matching mysql & mssql whileloop within an if caseRik Wasmus4 May
  • Myisam won't support replicationCharles Brown3 May
    • Re: Myisam won't support replicationAndrew Moore3 May
      • RE: Myisam won't support replicationRick James3 May
      • Myisam won't support replication in an MySQL Cluster environment Charles Brown4 May
  • Myisam won't support replication in an MySQL Cluster environment Charles Brown4 May
    • Re: Myisam won't support replication in an MySQL Cluster environmentReindl Harald4 May
      • RE: Myisam won't support replication in an MySQL Cluster environmentCharles Brown4 May
        • Re: Myisam won't support replication in an MySQL Cluster environmentReindl Harald4 May
        • Re: Myisam won't support replication in an MySQL Cluster environmentJohan De Meersman7 May
  • Re: mixing and matching mysql & mssql whileloop within an if caseAlex Schaft4 May