Thema: Create Table
Einzelnen Beitrag anzeigen
Alt 07-05-2003, 11:02   #9 (permalink)
lingamyoni.de
buttons ... ?
 
Benutzerbild von lingamyoni.de
 
Registriert seit: Oct 2002
Ort: an der sieg
Beiträge: 2.650
ok, hier meine kompletten skripts, das ganze ist in der test-phase, ich hänge ja am CREAT TABLE ;-):

PHP-Code:
<?
$row 
1;
$file "test.csv";
$fp fopen ($file,"r");
WHILE (
$data fgetcsv($fp10000"\n\r")){
    
$num count($data);
    echo 
"<p> $num fields in line $row: <br>\n";
    
$row++;
    for (
$i=0$i<$num$i++) {

         
$table_row split(";",$data[$i]);
         
$table_cols count($table_row);

//hier jetzt die includes:

    
include("dbconnect.php");
    include(
"create_db_table.php");

        for (
$c=0$c<$table_cols$c++){

         if(empty(
$table_row[$c])){
          echo 
"-<br>\n";
         } else {
            echo 
$table_row[$c]."<br>\n";
           }

        }


    }
    echo 
"<hr>";
}

fclose ($fp);
?>
//und nu create_db_table.php:
<?
$table_name 
"200305070939";
//$define = 'USE timo_test;';
$create "CREATE TABLE" $table_name"( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, a VARCHAR(1) NOT NULL);";

//$create = 'CREATE TABLE $table_name ( `id` INT(2) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `a` VARCHAR(1) NOT NULL, `b` VARCHAR(1) NOT NULL );';
$table_build mysql_query($create);
echo 
$table_build;
?>
...
habe auchmal die bindestriche weg gemacht, obwohl ich immer noch nicht verstehe, warumd die soo schlecht sind?!

gruß + dank ...
__________________

jeder von uns ist mehrere, ist viele, ist ein übermaß an selbsten. (pessoa)
-------
zick-zack zu fuss bevorzugt
-------
[STUFF] Zeiterfassung (PHP/MySQL)

-------
[STUFF] comax (CMS)
lingamyoni.de ist offline   Mit Zitat antworten