Seite 1 von 2

alli_update.php Problem

Verfasst: 10.06.2006 21:07
von Lenox82
Hier in der datei macht er zwar das Leeren der DB aber nicht das einfügen der einzelnen SQL-Dateien

bei mir leigen die sql-dateien im Ordner sql

kann mir einer please Helfen danke euch

alli_update.php

Code: Alles auswählen

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata); 

$page_title = 'Allianz Statistik Update'; 
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
	'body' => 'alli_update.tpl')
);

$tablet = "x_world";

	$sql= "TRUNCATE TABLE $tablet";

if( !($result = $db->sql_query($sql)) )

{
	message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )

{
	$files = array('/sql/1.sql', '/sql/2.sql', '/sql/3.sql', '/sql/4.sql', '/sql/5.sql' ,'/sql/6.sql' ,'/sql/7.sql' ,'/sql/8.sql' ,'/sql/9.sql' ,'/sql/10.sql', '/sql/11.sql'); // Hier die Dateien einfügen

	foreach( $files as $file )
	{
	$content = file_get_contents($file);
	$content = stripslashes(trim($content));
	$sql = explode(';', $content);
	foreach( $sql as $mysql )
	
	while ( $row = $db->sql_fetchrow($result) );
	$db->sql_freeresult($result);
}
	$exits = "<b>Die Daten von $tablet sind erfolgreich eingetragen wurden!</b>";
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>

Verfasst: 10.06.2006 21:35
von fanrpg

Code: Alles auswählen

<?php 
define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

$userdata = session_pagestart($user_ip, PAGE_INDEX); 
init_userprefs($userdata); 

$page_title = 'Allianz Statistik Update'; 
include($phpbb_root_path . 'includes/page_header.'.$phpEx); 

$template->set_filenames(array( 
   'body' => 'alli_update.tpl') 
); 

$tablet = "x_world"; 

   $sql= "TRUNCATE TABLE $tablet"; 

if( !($result = $db->sql_query($sql)) ) 

{ 
   message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql); 
} 

if ( $row = $db->sql_fetchrow($result) ) 

{ 
   $files = array('/sql/1.sql', '/sql/2.sql', '/sql/3.sql', '/sql/4.sql', '/sql/5.sql' ,'/sql/6.sql' ,'/sql/7.sql' ,'/sql/8.sql' ,'/sql/9.sql' ,'/sql/10.sql', '/sql/11.sql'); // Hier die Dateien einfügen 

   foreach( $files as $file ) 
   { 
   $content = file_get_contents($file); 
   $content = stripslashes(trim($content)); 
   $sql = explode(';', $content); 
   foreach( $sql as $mysql ) 
   {
    
   $result = $db->sql_query($mysql) or die(mysql_error());
   $db->sql_freeresult($result); 
   }
} 
   $exits = "<b>Die Daten von $tablet sind erfolgreich eingetragen wurden!</b>"; 
} 

$template->pparse('body'); 

include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 
?>

Verfasst: 10.06.2006 21:40
von Lenox82
Hmm... der führt aber die sql-dateien nicht aus so wie er es eigentlich sollte

Die Tablle leert er ja das ist schonmal wunderbar aber er führt die sql´s nicht aus

Also habe im ordner SQL 11 gesplittete SQL-Dateien und die solle er einlesen und dann diese in die tabelle einspeichern was er aber nicht macht!

Verfasst: 10.06.2006 22:50
von fanrpg
Fehlermeldung?

Verfasst: 11.06.2006 01:29
von Lenox82
Kommt keine LEIDER

Es wird wie ich oben schon schrieb zwar die DB geleert was auch gut so ist aber die entsprechenden SQL-Dateien werden nicht gelesen und gegeben falls in die Datenbank eingetragen

Verfasst: 12.06.2006 11:59
von Lenox82
*push*

Ja wollte nur mal fragen cob mir da jemand helfen kann, wenn da schon jemand dran ist dann sorry für den PUSH

Verfasst: 12.06.2006 13:28
von fanrpg

Code: Alles auswählen

<?php 
define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

$userdata = session_pagestart($user_ip, PAGE_INDEX); 
init_userprefs($userdata); 

$page_title = 'Allianz Statistik Update'; 
include($phpbb_root_path . 'includes/page_header.'.$phpEx); 

$template->set_filenames(array( 
   'body' => 'alli_update.tpl') 
); 

$tablet = "x_world"; 

   $sql= "TRUNCATE TABLE $tablet"; 

if( !($result = $db->sql_query($sql)) ) 

{ 
   message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql); 
} 

//if ( $row = $db->sql_fetchrow($result) ) 

//{ 
   $files = array('/sql/1.sql', '/sql/2.sql', '/sql/3.sql', '/sql/4.sql', '/sql/5.sql' ,'/sql/6.sql' ,'/sql/7.sql' ,'/sql/8.sql' ,'/sql/9.sql' ,'/sql/10.sql', '/sql/11.sql'); // Hier die Dateien einfügen 

   foreach( $files as $file ) 
   { 
   $content = file_get_contents($file); 
   $content = stripslashes(trim($content)); 
   $sql = explode(';', $content); 
   foreach( $sql as $mysql ) 
   { 
    
   $result = $db->sql_query($mysql) or die(mysql_error()); 
   $db->sql_freeresult($result); 
   } 
} 
   echo  "<b>Die Daten von $tablet sind erfolgreich eingetragen wurden!</b>"; 
//} 

$template->pparse('body'); 

include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 
?>

Verfasst: 12.06.2006 20:00
von Lenox82
Erstmal wieder ein Danke an dich

Aber nun hab ich diese Fehlermeldung:

Code: Alles auswählen

Warning: file_get_contents(): open_basedir restriction in effect. File(/sql/1.sql) is not within the allowed path(s): (/var/www/vhosts/D-W-S.lenox-design.de/httpdocs:/tmp) in /var/www/vhosts/D-W-S.lenox-design.de/httpdocs/alli_update.php on line 34

Warning: file_get_contents(/sql/1.sql): failed to open stream: Operation not permitted in /var/www/vhosts/D-W-S.lenox-design.de/httpdocs/alli_update.php on line 34

Verfasst: 12.06.2006 20:29
von fanrpg
Darfst auf die Dateien halt nicht zugreifen, warum auch immer.

Verfasst: 13.06.2006 00:03
von Lenox82
könntest du das dann so machen eventuell das er von der seite: http://welt3.travian.de/karte.sql die indsert´s nimmt und diese dann in die DB einfügt vorher natürlich löscht

Wäre zumindestens sehr net ;)