Hey.
Ich habe mir eine nette Funktion gebastelt welche ein paar Einträge in meine Tabelle machen soll. Leider aber crasht mir das Script sobald ich die Funktion ins Script packe, das heist, ich bekomme nurnoch eine leere Seite zurück, kein Echo ...
Hiermal meine Funktion:
Hier nun noch die uuid1(), uuid2(), ... Funktion:
Weis jemand wo mein Fehler liegt?
Gruß Tim
Ich habe mir eine nette Funktion gebastelt welche ein paar Einträge in meine Tabelle machen soll. Leider aber crasht mir das Script sobald ich die Funktion ins Script packe, das heist, ich bekomme nurnoch eine leere Seite zurück, kein Echo ...
Hiermal meine Funktion:
PHP:
function setinv($uuid) {
$my_inventory = uuid1();
$u2 = uuid2();
$u3 = uuid3();
$u4 = uuid4();
$u5 = uuid5();
$u6 = uuid6();
$u7 = uuid7();
$u8 = uuid8();
$u9 = uuid9();
$u10 = uuid10();
$u11 = uuid11();
$u12 = uuid12();
$u13 = uuid13();
$u14 = uuid14();
$u15 = uuid15();
$1 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('My Inventory','8','1','$my_inventory','$uuid','00000000-0000-0000-0000-000000000000')";
$2 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Textures','0','1','$u2','$uuid','$my_inventory')";
$3 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Sounds','1','1','$u3','$uuid','$my_inventory')";
$4 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Calling Cards','2','1','$u4','$uuid','$my_inventory')";
$5 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Landmarks','3','1','$u5','$uuid','$my_inventory')";
$6 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Clothing','5','1','$u6','$uuid','$my_inventory')";
$7 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Objects','6','1','$u7','$uuid','$my_inventory')";
$8 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Notecards','7','1','$u8','$uuid','$my_inventory')";
$9 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Scripts','10','1','$u9','$uuid','$my_inventory')";
$10 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Body Parts','13','1','$u10','$uuid','$my_inventory')";
$11 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Trash','14','1','$u11','$uuid','$my_inventory')";
$12 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Photo Album','15','1','$u12','$uuid','$my_inventory')";
$13 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Lost And Found','16','1','$u13','$uuid','$my_inventory')";
$14 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Animations','20','1','$u14','$uuid','$my_inventory')";
$15 = 'INSERT INTO inventoryfolders (folderName,type,version,folderID,agentID,parentFolderID) '.
"VALUES ('Gestures','21','1','$u15','$uuid','$my_inventory')";*/
mysql_query($1);
mysql_query($2);
mysql_query($3);
mysql_query($4);
mysql_query($5);
mysql_query($6);
mysql_query($7);
mysql_query($8);
mysql_query($9);
mysql_query($10);
mysql_query($11);
mysql_query($12);
mysql_query($13);
mysql_query($14);
mysql_query($15);
}
Hier nun noch die uuid1(), uuid2(), ... Funktion:
PHP:
function uuid1()
{
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
mt_rand( 0, 0x0fff ) | 0x4000,
mt_rand( 0, 0x3fff ) | 0x8000,
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
}
function uuid2()
{
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
mt_rand( 0, 0x0fff ) | 0x4000,
mt_rand( 0, 0x3fff ) | 0x8000,
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
}
Weis jemand wo mein Fehler liegt?
Gruß Tim