Haluk Karamete mixing and matching mysql & mssql whileloop within an if case
May 03, 2012; 10:20
Haluk Karamete
mixing and matching mysql & mssql whileloop within an if case
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
May 03
Rick James RE: mixing and matching mysql & mssql whileloop within an if case
May 03, 2012; 10:55
Rick James
RE: mixing and matching mysql & mssql whileloop within an if case
May 03
Brown, Charles Re: mixing and matching mysql & mssql whileloop within an if case
May 03, 2012; 15:26
Brown, Charles
Re: mixing and matching mysql & mssql whileloop within an if case
May 03
Baron Schwartz Re: mixing and matching mysql & mssql whileloop within an if case
May 03, 2012; 16:33
Baron Schwartz
Re: mixing and matching mysql & mssql whileloop within an if case
May 04
Alex Schaft Re: mixing and matching mysql & mssql whileloop within an if case
May 04, 2012; 07:40
Alex Schaft
Re: mixing and matching mysql & mssql whileloop within an if case
May 04
Rik Wasmus Re: mixing and matching mysql & mssql whileloop within an if case
May 04, 2012; 12:11
Rik Wasmus
Re: mixing and matching mysql & mssql whileloop within an if case
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!