FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Adding MSSQL support to a MySQL/Postgres script
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Adding MSSQL support to a MySQL/Postgres script [message #170132 is a reply to message #170128] Mon, 11 October 2010 21:39 Go to previous messageGo to previous message
DiamondEagle is currently offline  DiamondEagle
Messages: 11
Registered: October 2010
Karma:
Junior Member
On Oct 11, 2:25 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>
> So, what do you actually have in $table?
>

Thanks Jerry.

The only reference to $table is in the "while ($table =
mssql_fetch_assoc($query))" loop in the case statement. I think I
fixed the script by copying the Postgres SQL into the MSSQL case and
modifying it to use the MSSQL functions. The switch statement in
mergeuser_get_userid_columns() function now has:

case 'mssql_n':
$query = mssql_query("
SELECT column_name
FROM information_schema.columns
WHERE table_name = '$tablename'
AND ( (column_name LIKE 'userid')
OR (column_name LIKE 'user_id')
OR (column_name LIKE 'id_user')
)
");

if (mssql_num_rows($query) > 0) {
while ($column = mssql_fetch_assoc($query)) {
if (!empty($column['column_name'])) {
$columns[] = trim($column['column_name']);
}
}
}
break;


And the switch statement in mergeuser_get_tables() function has:

case 'mssql_n':
$query = mssql_query("SELECT * FROM information_schema.tables");
if (mssql_num_rows($query) > 0) {
while ($table = mssql_fetch_assoc($query)) {
$tablename = trim($table['TABLE_NAME']);
if (!empty($tablename)) {
$tables[] = $tablename;
}
}
}
break;

It seems to be working now. Thanks.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Cursor to 1st fllable field?
Next Topic: php://memory and php://temp
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 23:45:36 GMT 2024

Total time taken to generate the page: 0.05099 seconds