View Issue Details

IDProjectCategoryView StatusLast Update
0005157phpList 3 applicationSubscriber Importpublic23-05-12 18:36
Reporterphx Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Summary0005157: sql import does not work ( import4.php )
DescriptionIt seams that Sql_Query function use $GLOBALS["database_connection"] with is not set during import4 local or remote connection.

So you can't connect to another db than your new phplist.

I forced phplist to set GLOBALS["database_connection"] and it seems to work.

I did not read all you code so I add a connectLocal(); at the end to be sure to get my new phplist work perfectly.
Additional Informationfunction connectLocal() {
  $database_connection = Sql_Connect(
    $GLOBALS["database_host"],
    $GLOBALS["database_user"],
    $GLOBALS["database_password"],
    $GLOBALS["database_name"]);
  $GLOBALS["database_connection"] = $database_connection;
  return $database_connection;
}

function connectRemote() {
  $database_connection = Sql_Connect(
    $_POST["remote_host"],
    $_POST["remote_user"],
    $_POST["remote_password"],
    $_POST["remote_database"]);
  $GLOBALS["database_connection"] = $database_connection;
  return $database_connection;
}
TagsNo tags attached.

Relationships

related to 0002705 closed PHPList v2.11 release 

Activities

heritage

19-06-09 20:45

reporter   ~0050685

Is there going to be a mod for this in the next release?

I see the relationship link no longer exists. Seems like this mod might work with the latest release.

function connectLocal() {
  $database_connection = Sql_Connect(
    $GLOBALS["database_host"],
    $GLOBALS["database_user"],
    $GLOBALS["database_password"],
    $GLOBALS["database_name"]);
    $GLOBALS["database_connection"] = $database_connection;
   return $database_connection;
}
function connectRemote() {
  $database_connection = Sql_Connect(
  $_POST["remote_host"],
  $_POST["remote_user"],
  $_POST["remote_password"],
  $_POST["remote_database"]);
  $GLOBALS["database_connection"] = $database_connection;
  return $database_connection;
}

I am still troubleshooting.

heritage

19-06-09 20:46

reporter   ~0050686

version, 2.10.10 - 5 May 2009 - 7:39pm GMT

h2b2

08-10-10 00:11

manager   ~0051117

This related forum thread contains a number of interesting suggestions:
http://forums.phplist.com/viewtopic.php?p=63305#p63305
http://forums.phplist.com/viewtopic.php?p=78734#p78734
http://forums.phplist.com/viewtopic.php?p=79368#p79368