<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>tutorials.de - PHP</title>
		<link>http://www.tutorials.de/</link>
		<description><![CDATA[Forum & Hilfe zu PHP (PHP4 & PHP5), die Programmiersprache für dynamische Webseiten, Skripte, Programmierung]]></description>
		<language>de</language>
		<lastBuildDate>Wed, 08 Sep 2010 23:01:27 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>30</ttl>
		<image>
			<url>http://style.tutorials.de/v10/images/misc/rss.png</url>
			<title>tutorials.de - PHP</title>
			<link>http://www.tutorials.de/</link>
		</image>
		<item>
			<title>Objekt in Array umwandeln</title>
			<link>http://www.tutorials.de/php/366051-objekt-array-umwandeln.html</link>
			<pubDate>Wed, 08 Sep 2010 16:37:26 GMT</pubDate>
			<description><![CDATA[Guten Abend! 
 
Ich nutze die folgende Funktion, um ein Objekt in ein Array umzuwandeln: 
 
 
PHP: 
--------- 
function buildarray($object) { 
	if (is_object ( $object ) == true) { 
		settype ( $object, "array" );]]></description>
			<content:encoded><![CDATA[<div>Guten Abend!<br />
<br />
Ich nutze die folgende Funktion, um ein Objekt in ein Array umzuwandeln:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP-Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">buildarray</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">is_object&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$object&nbsp;</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">settype&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$object</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"array"&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #0000BB">$object&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$key&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$value</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;((</span><span style="color: #0000BB">is_array&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;or&nbsp;(</span><span style="color: #0000BB">is_object&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$array&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$key</span><span style="color: #007700">&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">buildarray&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$array&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$key</span><span style="color: #007700">&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">utf8decode&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$array</span><span style="color: #007700">;<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> Nun zu meinem Problem: Das Objekt stammt von der Funktion <b>simplexml_load_string ()</b> und in dem XML gibt es teilweise doppelte gleiche Namen auf der gleichen Ebene. Mein Array sieht nun also nicht mehr wie das Original aus, sondern es wird <b>[0], [1], [2] usw.</b> vor den eigentlichen Key gesetzt. Wie kann man das unterbinden?<br />
<br />
Oder habe ich einen kompletten Denkfehler?</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>Sasser</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366051-objekt-array-umwandeln.html</guid>
		</item>
		<item>
			<title>brauche Denkanstoß um Temporäre Ordner zu Löschen</title>
			<link>http://www.tutorials.de/php/366047-brauche-denkanstoss-um-temporaere-ordner-zu-loeschen.html</link>
			<pubDate>Wed, 08 Sep 2010 15:18:31 GMT</pubDate>
			<description><![CDATA[Hallo Leute, 
 
ich habe einen Bildupload in meinem Shop. 
Nun starte ich am Anfang eine Besucher Session mit: 
 
 
PHP: 
--------- 
$_SESSION['besucher_id'] = rand(1,100000000); 
---------]]></description>
			<content:encoded><![CDATA[<div>Hallo Leute,<br />
<br />
ich habe einen Bildupload in meinem Shop.<br />
Nun starte ich am Anfang eine Besucher Session mit:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP-Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">$_SESSION</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'besucher_id'</span><span style="color: #007700">&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">rand</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">100000000</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> Wenn ein besucher nun ein Bild hochlädt, dann wird das erstmal in einem Temorären Ordner gespeichert.<br />
Der Ordner hat die Bezeichnung der erstellten Besucher Session.<br />
<br />
Wenn der Besucher nun einen Artikel bestellt dann Lösche ich diesen temporären Ordner und kopiere das hochgeladene Bild in einen Ordner auf den nur ich Zugriff habe.<br />
<br />
Was mache ich aber wenn der Besucher ein Bild hochlädt und die Seite verlässt ohne eine Bestellung zu tätigen.<br />
<br />
Wie Lösche ich den temporären Ordner dann, ohne dass ich die anderen Ordner, von anderen Besuchern gleichzeitig lösche?<br />
<br />
Wie stellt man sowas an?<br />
<br />
Gruß</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>xtramen01</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366047-brauche-denkanstoss-um-temporaere-ordner-zu-loeschen.html</guid>
		</item>
		<item>
			<title>JOINs mit mehreren Datensätzen verarbeiten</title>
			<link>http://www.tutorials.de/php/366041-joins-mit-mehreren-datensaetzen-verarbeiten.html</link>
			<pubDate>Wed, 08 Sep 2010 13:34:30 GMT</pubDate>
			<description>Hallo zusammen, 
 
ich habe folgendes Problem. 
 
Ich habe eine SQL-Abfrage über mehrere(5) Tabellen. 
 
Wenn ich jetzt z.b. so eine Tabellenstruktur habe: 
 
Ich weiß die struktur im beispiel ist nicht gut aber mir is kein besseres Beispiel eingefallen und bei meinem Problem fehlt euch der sinn^^</description>
			<content:encoded><![CDATA[<div>Hallo zusammen,<br />
<br />
ich habe folgendes Problem.<br />
<br />
Ich habe eine SQL-Abfrage über mehrere(5) Tabellen.<br />
<br />
Wenn ich jetzt z.b. so eine Tabellenstruktur habe:<br />
<br />
Ich weiß die struktur im beispiel ist nicht gut aber mir is kein besseres Beispiel eingefallen und bei meinem Problem fehlt euch der sinn^^<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><table class="" style="font-family:monospace;"><tbody><tr><td class="bbcode_code_linenumbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="bbcode_code_highlight"><pre>Tabelle_1 (User)
&nbsp;
id | name | partner
1 | Gilbert | 1
&nbsp;
Tabelle_2 (Konten)
&nbsp;
id | konto | user | ...
1 | Bank_X | 1 | ...
2 | Bank_Y | 1 | ...
&nbsp;
Tabelle_3 (Partner)
&nbsp;
id | name | ..
1 | FitzGerald | ...
&nbsp;
Tabelle_4 (Freunde vom partner)
&nbsp;
id | name | partner_id(der partner der aus tabelle 1 genommen wird) | wo_kennengelernt | ...
1 | Hubert| 1 | ...
2 | Hugo | 1
3 | Gordon| 1
&nbsp;
Tabelle_5 (inventar)
&nbsp;
id | gegenstand | ...
1 | Kühlschrank
2 | Schinken
3 | Katoffel</pre></td></tr></tbody></table></code><hr />
</div> <br />
Ich habe bereits eine Abfrage die mir anhand der Userid (tabelle1) alle Infos holt<br />
<br />
Nun gibt mir aber phpmyadmin das ganze etwa so aus: (nehme in dem beispiel nur 3 Tabellen weils sonst zu viel wird)<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><table class="" style="font-family:monospace;"><tbody><tr><td class="bbcode_code_linenumbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="bbcode_code_highlight"><pre>&nbsp;
id | name | konto | gegenstand | ...
1 | Gilbert | Bank_X | Kühlschrank
1 | Gilbert | Bank_X | Schinken
1 | Gilbert | Bank_X | Katoffel
1 | Gilbert | Bank_Y | Kühlschrank
1 | Gilbert | Bank_Y | Schinken
1 | Gilbert | Bank_Y | Katoffel</pre></td></tr></tbody></table></code><hr />
</div> <br />
Wenn ich aber jetz ein Objekt habe das die Daten verwalten soll will ich jetz alles in getrennte objekte speicher:<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><table class="" style="font-family:monospace;"><tbody><tr><td class="bbcode_code_linenumbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="bbcode_code_highlight"><pre>$row = fetch_object($db_result);
&nbsp;
// Code das ich dieses Ergebnis erhalte:
&nbsp;
$user_object
&nbsp;
// 1 User object wo die infos drinstehen
&nbsp;
$gegenstaende
&nbsp;
// array mit so vielen gegenstandobjekten wie gegenstände, problem:
// Gegenstände kommen ja 2mal vor wegen den beiden konten
&nbsp;
$konten
&nbsp;
// selbes problem wie bei den gegenständen nur das sie halt 3 mal vorkommen</pre></td></tr></tbody></table></code><hr />
</div> <br />
Versteht ihr mein Problem! also ich will die infos auftrennen und in objekte unterteilen ohne das ich daten öfter eintrage</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>JOINFRAGENSEPP</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366041-joins-mit-mehreren-datensaetzen-verarbeiten.html</guid>
		</item>
		<item>
			<title>CSV mittels Array in MySql-Datenbank speichern</title>
			<link>http://www.tutorials.de/php/366039-csv-mittels-array-mysql-datenbank-speichern.html</link>
			<pubDate>Wed, 08 Sep 2010 13:30:16 GMT</pubDate>
			<description><![CDATA[Hallo, 
 
da die MySql-Datenbank die LOAD DATA INFILE - Funktion nicht zulässt muss ich die leider über die INSERT INTO funktion meine CSV importieren. 
Leider werde die DATEN nicht in der DB gespeichert. WARUM? 
 
 
PHP: 
--------- 
$handle = fopen('webgains_datenfeed.csv', 'r'); 
$zeilen =...]]></description>
			<content:encoded><![CDATA[<div>Hallo,<br />
<br />
da die MySql-Datenbank die LOAD DATA INFILE - Funktion nicht zulässt muss ich die leider über die INSERT INTO funktion meine CSV importieren.<br />
Leider werde die DATEN nicht in der DB gespeichert. WARUM?<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP-Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">$handle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'webgains_datenfeed.csv'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'r'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$zeilen&nbsp;</span><span style="color: #007700">=&nbsp;array();<br /><br /><br /></span><span style="color: #0000BB">$aktuelleZeile&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />while(</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fgetcsv</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1500</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">';'</span><span style="color: #007700">))<br />{<br />&nbsp;</span><span style="color: #0000BB">$server&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$user&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'root'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pw&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$datenbank&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'lensclub'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$verbindung&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$server</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$pw</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$verbindung</span><span style="color: #007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_select_db</span><span style="color: #007700">(</span><span style="color: #0000BB">$datenbank</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">mysql_error&nbsp;</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Verbindung&nbsp;steht&nbsp;oder&nbsp;steh&nbsp;nicht'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$db</span><span style="color: #007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&lt;br/&gt;&nbsp;Datenbank&nbsp;existiert&nbsp;oder&nbsp;existiert&nbsp;nicht&lt;br/&gt;&lt;br/&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">mysql_query&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;´datenfeed`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUES&nbsp;('$daten')"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;</span><span style="color: #0000BB">$aktuelleZeile</span><span style="color: #007700">++;<br />}<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> <br />
<br />
die echo Ausgaben sind nur zum testen und da sie so oft erscheinen, wei auch Zeilen in der CSV sind, denke ich das es am SQL-Befehl liegt. Aber wo ist der Fehlerteufel versteckt?<br />
<br />
<br />
Gruß, Pat</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>Kalito</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366039-csv-mittels-array-mysql-datenbank-speichern.html</guid>
		</item>
		<item>
			<title>Variablen aus URL empfangen und ausgeben</title>
			<link>http://www.tutorials.de/php/366038-variablen-aus-url-empfangen-und-ausgeben.html</link>
			<pubDate>Wed, 08 Sep 2010 12:56:32 GMT</pubDate>
			<description><![CDATA[Hallo, wie kann ich denn alle Arrays, die in einer URL übergeben werden, empfangen und genauso sortiert wieder ausgeben: 
 
URL: index.php?&Bauen[]=1&Bauen[]=2&Bauen[]=3&Kalksand[]=1&Kalksand[]=2& 
 
 
AUSGABE: &Bauen[]=1&Bauen[]=2&Bauen[]=3&Kalksand[]=1&Kalksand[]=2& 
 
Grüße & Danke 
 
ber]]></description>
			<content:encoded><![CDATA[<div>Hallo, wie kann ich denn alle Arrays, die in einer URL übergeben werden, empfangen und genauso sortiert wieder ausgeben:<br />
<br />
URL: index.php?&amp;Bauen[]=1&amp;Bauen[]=2&amp;Bauen[]=3&amp;Kalksand[]=1&amp;Kalksand[]=2&amp;<br />
<br />
<br />
AUSGABE: &amp;Bauen[]=1&amp;Bauen[]=2&amp;Bauen[]=3&amp;Kalksand[]=1&amp;Kalksand[]=2&amp;<br />
<br />
Grüße &amp; Danke<br />
<br />
ber</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>ber</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366038-variablen-aus-url-empfangen-und-ausgeben.html</guid>
		</item>
		<item>
			<title>XML-TAG-ID mittels PHP auslesen und in DB speichern</title>
			<link>http://www.tutorials.de/php/366035-xml-tag-id-mittels-php-auslesen-und-db-speichern.html</link>
			<pubDate>Wed, 08 Sep 2010 11:28:53 GMT</pubDate>
			<description><![CDATA[Hallo PHP Freunde, 
 
ich stehe gerade ziemlich auf dem Schlauch. Ich soll mittels PHP ein XML Dokument auslesen. Dies ist weiterhin kein großes Problem. Das richtige Auslesen der "IDs" in den Tags jedoch schon. Am Ende soll dies in eine MySQL DB eingetragen werden. Die XML sieht so aus: 
 
<div...]]></description>
			<content:encoded><![CDATA[<div>Hallo PHP Freunde,<br />
<br />
ich stehe gerade ziemlich auf dem Schlauch. Ich soll mittels PHP ein XML Dokument auslesen. Dies ist weiterhin kein großes Problem. Das richtige Auslesen der &quot;IDs&quot; in den Tags jedoch schon. Am Ende soll dies in eine MySQL DB eingetragen werden. Die XML sieht so aus:<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><table class="" style="font-family:monospace;"><tbody><tr><td class="bbcode_code_linenumbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="bbcode_code_highlight"><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;userimport&gt;
&nbsp; &nbsp; &lt;organization id=&quot;BehoerdeA&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;user&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;profile&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;credentials&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;login-id&gt;mustermann&lt;/login-id&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;password&gt;muster123&lt;/password&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;enabled&gt;1&lt;/enabled&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;memoryQuestion&gt;Name des Hundes?&lt;/memoryQuestion&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;memoryAnswer&gt;Mo&lt;/memoryAnswer&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/credentials&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;first-name&gt;Peter&lt;/first-name&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;last-name&gt;Mustermann&lt;/last-name&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;title&gt;Dr.&lt;/title&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;middleName&gt;von&lt;/middleName&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;addresses&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;address name=&quot;Default Address&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;city&gt;Wiesbaden&lt;/city&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;postal-code&gt;56780&lt;/postal-code&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;street&gt;Frankfurter Str. 1&lt;/street&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;street2&gt;Raum 47&lt;/street2&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;phone-business-direct&gt;0621 / 6560 - 100&lt;/phone-business-direct&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;email&gt;peter.mustermann@localhost&lt;/email&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/address&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/addresses&gt;&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-groups id=&quot;AbteilungA&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Beschaffer&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Standard-Mitarbeiter&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/user-groups&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-groups id=&quot;AbteilungB&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Genehmigender&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Standard-Mitarbeiter&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Aushilfe&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Zivi&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/user-groups&gt;&nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/profile&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/user&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;user&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;profile&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;credentials&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;login-id&gt;deich&lt;/login-id&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;password&gt;deich123&lt;/password&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;enabled&gt;1&lt;/enabled&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;memoryQuestion&gt;Name der Katze?&lt;/memoryQuestion&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;memoryAnswer&gt;Miau&lt;/memoryAnswer&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/credentials&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;first-name&gt;Dieter&lt;/first-name&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;last-name&gt;Deich&lt;/last-name&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;title&gt;&lt;/title&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;middleName&gt;&lt;/middleName&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;addresses&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;address name=&quot;Default Address&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;city&gt;Paderborn&lt;/city&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;postal-code&gt;33104&lt;/postal-code&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;street&gt;Briloner Str. 1&lt;/street&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;street2&gt;Raum 46&lt;/street2&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;phone-business-direct&gt;05251 / 6510 - 100&lt;/phone-business-direct&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;email&gt;dieter.deich@localhost&lt;/email&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/address&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/addresses&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-groups id=&quot;AbteilungC&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Standard-Mitarbeiter&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Azubi&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/user-groups&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-groups id=&quot;AbteilungD&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Standard-Mitarbeiter&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;user-group id=&quot;Azubi&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/user-groups&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/profile&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/user&gt;
&nbsp; &nbsp; &lt;/organization&gt;
&lt;/userimport&gt;</pre></td></tr></tbody></table></code><hr />
</div> <br />
Im speziellen meine ich die IDs der XML Tags &quot;user-groups&quot; &amp; &quot;user-group&quot;. Diese sollten am besten mittels einer Schleife ausgelesen und in eine DB eingetragen werden. Das einlesen und eintragen der XML Datei ist kein Problem, funktioniert auch. Das rochtige einlesen und eintragen der &quot;IDs&quot; wie bspw. &quot;&lt;user-groups <b>id=&quot;AbteilungA</b>&quot;&gt;&quot; jedoch schon. Mein Code sieht derzeit so aus:<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP-Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php&nbsp;&nbsp;<br /><br /></span><span style="color: #FF8000">//Datenbankverbindung<br /></span><span style="color: #007700">include(</span><span style="color: #DD0000">"db_connect.php"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//pdf&nbsp;erzeugung<br /></span><span style="color: #007700">include(</span><span style="color: #DD0000">"fpdf.php"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//angabe&nbsp;zum&nbsp;pfad&nbsp;der&nbsp;xml-datei&nbsp;und&nbsp;speichern&nbsp;in&nbsp;eine&nbsp;variable<br /></span><span style="color: #0000BB">$file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"beispiel_xml.xml"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$xml&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">simplexml_load_file</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//dateigröße&nbsp;in&nbsp;variable&nbsp;speichern<br /></span><span style="color: #0000BB">$xmlmax&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$max&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//speichern&nbsp;der&nbsp;werte&nbsp;in&nbsp;ein&nbsp;array<br /></span><span style="color: #0000BB">$login_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/credentials/login-id'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$password&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/credentials/password'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$enabled&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/credentials/enabled'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$memoryQuestion&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/credentials/memoryQuestion'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$memoryAnswer&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/credentials/memoryAnswer'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$first_name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/first-name'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$last_name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/last-name'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$title&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/title'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$middleName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/middleName'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$city&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/addresses/address/city'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$postal_code&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/addresses/address/postal-code'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$street&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/addresses/address/street'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$phone_business_direct&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/addresses/address/phone-business-direct'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$email&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/addresses/address/email'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$user_groups&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/user-groups'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$user_role&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile/user-groups/user-group'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$profile&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">xpath</span><span style="color: #007700">(</span><span style="color: #DD0000">'/userimport/organization/user/profile'</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$user_groups</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">1</span><span style="color: #007700">&#93;);<br /><br /><br /><br /><br /></span><span style="color: #0000BB">$j&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />for(</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">$max</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">++){<br /><br /></span><span style="color: #FF8000">//echo&nbsp;"i:&nbsp;".$i."&lt;br&gt;";&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$enabled_int&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">intval</span><span style="color: #007700">(</span><span style="color: #0000BB">$enabled</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$i</span><span style="color: #007700">&#93;);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$postal_code_int&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">intval</span><span style="color: #007700">(</span><span style="color: #0000BB">$postal_code</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$i</span><span style="color: #007700">&#93;);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//eintrag&nbsp;in&nbsp;Datenbank<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$insert&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;kdb&nbsp;(loginid,&nbsp;password,&nbsp;enabled,&nbsp;memoryquestion,&nbsp;memoryanswer,&nbsp;firstname,&nbsp;lastname,&nbsp;title,&nbsp;middlename,&nbsp;city,&nbsp;postalcode,&nbsp;street,&nbsp;phonebusinessdirect,&nbsp;email)&nbsp;VALUES&nbsp;('$login_id&#91;$i&#93;',&nbsp;'$password&#91;$i&#93;',&nbsp;'$enabled_int',&nbsp;'$memoryQuestion&#91;$i&#93;',&nbsp;'$memoryAnswer&#91;$i&#93;',&nbsp;'$first_name&#91;$i&#93;',&nbsp;'$last_name&#91;$i&#93;',&nbsp;'$title&#91;$i&#93;',&nbsp;'$middleName&#91;$i&#93;',&nbsp;'$city&#91;$i&#93;',&nbsp;'$postal_code_int',&nbsp;'$street&#91;$i&#93;',&nbsp;'$phone_business_direct&#91;$i&#93;',&nbsp;'$email&#91;$i&#93;')"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$eintragen&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$insert</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//echo&nbsp;$eintragen;<br /><br />//&nbsp;$groupmax&nbsp;=&nbsp;count($profile&#91;$i&#93;)-6;<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;//echo&nbsp;$groupmax."&lt;br&gt;";<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;$tmp&nbsp;=&nbsp;0;<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;for($j&nbsp;=&nbsp;0;&nbsp;$j&nbsp;&lt;=&nbsp;$groupmax;&nbsp;$j++){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;echo&nbsp;"j:&nbsp;".$j."&lt;br&gt;";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;$department&nbsp;=&nbsp;$user_groups&#91;$j&#93;-&gt;attributes();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;echo&nbsp;"Department:&nbsp;".$department;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;echo&nbsp;"&lt;br&gt;";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;$rolemax&nbsp;=&nbsp;count($user_groups&#91;$j&#93;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;echo&nbsp;"rolemax:&nbsp;".$rolemax."&lt;br&gt;";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;for($k&nbsp;=&nbsp;$tmp;&nbsp;$k&nbsp;&lt;=&nbsp;$rolemax;&nbsp;$k++){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;echo&nbsp;"k:&nbsp;".$k."&lt;br&gt;";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;$role&nbsp;=&nbsp;$user_role&#91;$k&#93;-&gt;attributes();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;echo&nbsp;"Role:&nbsp;".$role;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;echo&nbsp;"&lt;br&gt;";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;$tmp&nbsp;=&nbsp;$k+1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;//echo&nbsp;"&lt;br&gt;TEMP:".$tmp."&lt;br&gt;";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #FF8000">//for($i&nbsp;=&nbsp;0;$i&nbsp;&lt;=&nbsp;$max;$i++){<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">for(</span><span style="color: #0000BB">$j&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;</span><span style="color: #0000BB">$j&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$profile</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">0</span><span style="color: #007700">&#93;)-</span><span style="color: #0000BB">5</span><span style="color: #007700">;</span><span style="color: #0000BB">$j</span><span style="color: #007700">++){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$department</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$j</span><span style="color: #007700">&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">$user_groups</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$j</span><span style="color: #007700">&#93;-&gt;</span><span style="color: #0000BB">attributes</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//var_dump($department&#91;$j&#93;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$j</span><span style="color: #007700">.</span><span style="color: #DD0000">"Department:&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$department</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$j</span><span style="color: #007700">&#93;.</span><span style="color: #DD0000">"&lt;br&gt;"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">$tmp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />for(</span><span style="color: #0000BB">$p&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$tmp</span><span style="color: #007700">;</span><span style="color: #0000BB">$p&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$user_groups</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">1</span><span style="color: #007700">&#93;)-</span><span style="color: #0000BB">1</span><span style="color: #007700">;</span><span style="color: #0000BB">$p</span><span style="color: #007700">++){<br /><br /></span><span style="color: #0000BB">$role&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$user_role</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$p</span><span style="color: #007700">&#93;-&gt;</span><span style="color: #0000BB">attributes</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Role:&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$role</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;br&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tmp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$p</span><span style="color: #007700">;<br />}<br /><br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #FF8000">//}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></code><hr />
</div> Da sind teilweise noch auskommentierte Codeblöcke drin, die nicht so wirklich funktionieren wollen. Wichtig ist nur, das am Ende in der Tabelle folgendes eingetragen wird:<br />
loginid, Abteilung (id des Tags &lt;user-groups&gt;) und recht (id des tags &quot;&lt;user-group&gt;).<br />
<br />
Das Problem ist auch, das Array mit den ids des Tags &lt;user-group&gt; nur ein Array ist. Sprich, die Elemente 1 - x belegt sind. Ich hatte es, wie man im auskommentierten Codeblock sieht, versucht mit einem zwischenspeicher. Hat jedoch auch nicht geholfen.<br />
<br />
Hat jemand von euch einen Hinweis, Tipp oder Lösungsvorschlag? Ich steh da derzeit total auf dem Schlauch...<br />
<br />
Vielen Dank schonmal.<br />
<br />
Viele Grüße<br />
Moritz</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>Mauritius</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366035-xml-tag-id-mittels-php-auslesen-und-db-speichern.html</guid>
		</item>
		<item>
			<title>mySQL Datenbank kopieren</title>
			<link>http://www.tutorials.de/php/366027-mysql-datenbank-kopieren.html</link>
			<pubDate>Wed, 08 Sep 2010 08:33:05 GMT</pubDate>
			<description>Hallo zusammen. 
 
Ich habe folgendes Problem: 
 
Ich möchte von einem fremden Server eine Datenbank mit Inhalt und Struktur (wenn möglich, sonst nur Inhalt) auf meinen Server kopieren. Das ganze sollte aber als Cronjob ablaufen, den ich von meinem System aus starte. 
 
Ist sowas möglich und wenn...</description>
			<content:encoded><![CDATA[<div>Hallo zusammen.<br />
<br />
Ich habe folgendes Problem:<br />
<br />
Ich möchte von einem fremden Server eine Datenbank mit Inhalt und Struktur (wenn möglich, sonst nur Inhalt) auf meinen Server kopieren. Das ganze sollte aber als Cronjob ablaufen, den ich von meinem System aus starte.<br />
<br />
Ist sowas möglich und wenn ja, wie?<br />
<br />
Danke schonmal für eure Hilfe.<br />
<br />
CU SAM<br />
<a href="http://www.mehr-autoteile.de" target="_blank">gebrauchte Autoteile</a><br />
<a href="http://www.mehr-autoteile.de/php/shop/shop-tuning.php" target="_blank">Tuning Shop online</a></div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>SAMariter</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366027-mysql-datenbank-kopieren.html</guid>
		</item>
		<item>
			<title>Benutzung von FILTER_VALIDATE_EMAIL sinnvoll?</title>
			<link>http://www.tutorials.de/php/366022-benutzung-von-filter_validate_email-sinnvoll.html</link>
			<pubDate>Wed, 08 Sep 2010 01:35:13 GMT</pubDate>
			<description>Hallo. 
Bin gerade am rumprobieren wegen der Gültigkeit von eMails. 
 
Klar könnte ich eine vorgefertigte Funktion verwenden, aber ich will eben was eigenes probieren. Jetzt bin ich auf filter_var mit FILTER_VALIDATE_EMAIL gestoßen. 
Leider zeichnet es eine eMail mit verschiedenen (erlaubten)...</description>
			<content:encoded><![CDATA[<div>Hallo.<br />
Bin gerade am rumprobieren wegen der Gültigkeit von eMails.<br />
<br />
Klar könnte ich eine vorgefertigte Funktion verwenden, aber ich will eben was eigenes probieren. Jetzt bin ich auf filter_var mit FILTER_VALIDATE_EMAIL gestoßen.<br />
Leider zeichnet es eine eMail mit verschiedenen (erlaubten) Sonderzeichen im local part (Zeichenzahl unter 64) jedoch als invalid aus und überprüft auch nicht die domain des global parts.<br />
<br />
Daher würde mich interessieren, ob der Einsatz von FILTER_VALIDATE_EMAIL überhaupt sinnvoll ist, oder ob ich für den local part lieber eine Zeichenüberprüfung verwenden sollte?<br />
<br />
Gruß :)</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>das_element</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366022-benutzung-von-filter_validate_email-sinnvoll.html</guid>
		</item>
		<item>
			<title>User finden, die KEINEN Termin gebucht haben</title>
			<link>http://www.tutorials.de/php/366019-user-finden-die-keinen-termin-gebucht-haben.html</link>
			<pubDate>Tue, 07 Sep 2010 20:43:47 GMT</pubDate>
			<description>Hallo, ich will in meinem PHP Projekt die User einer Firma finden, die an einem bestimmten Tag KEINEN Termin gebucht haben. Das ganze sollte möglichst schon in der SQL Abfrage der DB stattfinden. Ich stehe z.Zt. wohl voll auf dem Schlauch. Ich bekomme immer die User angezeigt, die an dem Tag einen...</description>
			<content:encoded><![CDATA[<div>Hallo, ich will in meinem PHP Projekt die User einer Firma finden, die an einem bestimmten Tag KEINEN Termin gebucht haben. Das ganze sollte möglichst schon in der SQL Abfrage der DB stattfinden. Ich stehe z.Zt. wohl voll auf dem Schlauch. Ich bekomme immer die User angezeigt, die an dem Tag einen Termin gebucht haben. Ich will aber eben nicht diese sondern die verbleibenden als Ergebnis haben. Diese will ich per Email auf freie Termine aufmerksam machen.<br />
Hier meine SQL abfrage bis jetzt:<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><table class="" style="font-family:monospace;"><tbody><tr><td class="bbcode_code_linenumbers"><pre>1
2
3
4
</pre></td><td class="bbcode_code_highlight"><pre>SELECT `Email` FROM `Customer`, `Reservation` WHERE 
`Customer`.`CompanyID` &nbsp;= 3 AND
`Reservation`.`Datum` = '2010-09-09' AND
`Reservation`.`CustomerID` = `Customer`.`CustomerID`</pre></td></tr></tbody></table></code><hr />
</div> Diese Abfrage gibt natürlich nur die Kunden aus die an diesem Tag gebucht haben. Aber wie frage ich nun die anderen ab.<br />
Bin über jeden 'Wink mit dem Zaunpfahl' dankbar.<br />
Gruß Heiko<br />
<br />
P.S. Ich bastele gerade auch an `Reservation`.`Datum` != xxx<br />
und SELECT DISTINCT Email from...<br />
bekomme dabei aber noch immer nicht nur die User die an diesem einen Tag keinen Termin gebucht haben. Langsam bin ich am verzweifeln...</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>McMay</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366019-user-finden-die-keinen-termin-gebucht-haben.html</guid>
		</item>
		<item>
			<title>array: Paad des ersten Ordners von mehreren ausgeben</title>
			<link>http://www.tutorials.de/php/366013-array-paad-des-ersten-ordners-von-mehreren-ausgeben.html</link>
			<pubDate>Tue, 07 Sep 2010 17:27:58 GMT</pubDate>
			<description>Hallo, 
 
ich versuch ne ganz simple Funktion zu erstellen ... aber schaffs net ... 
 
ich möchte, dass in den Ordner ./hallo/ 
geschaut wird. in diesem Ordner liegen ein oder mehr Ordner. 
Ich möchte jetzt nicht die ganze Liste aller Ordner anzeigen lassen, sondern nur den Pfad zu dem alphabetisch...</description>
			<content:encoded><![CDATA[<div>Hallo,<br />
<br />
ich versuch ne ganz simple Funktion zu erstellen ... aber schaffs net ...<br />
<br />
ich möchte, dass in den Ordner ./hallo/<br />
geschaut wird. in diesem Ordner liegen ein oder mehr Ordner.<br />
Ich möchte jetzt nicht die ganze Liste aller Ordner anzeigen lassen, sondern nur den Pfad zu dem alphabetisch ersten Ordner in ./hallo/<br />
<br />
hoffe jemand kann mir helfen.<br />
<br />
Vielen Dank im Voraus!</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>fx001</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366013-array-paad-des-ersten-ordners-von-mehreren-ausgeben.html</guid>
		</item>
		<item>
			<title><![CDATA[Per JS dynamische<ipnput> Felder per $_POST Abfragen!?]]></title>
			<link>http://www.tutorials.de/php/366006-per-js-dynamische-ipnput-felder-per-_post-abfragen.html</link>
			<pubDate>Tue, 07 Sep 2010 15:14:27 GMT</pubDate>
			<description>Hi, 
 
ich habe ein einfaches Formular, welches aus statischen Felder und per JavaScript dynamisch generierten Feldern besteht. Je nach Auswahl, werden verschiedene neue Felder (input, select, textarea etc.) hinzugefügt. 
 
Mein Problem ist nun das ich, nachdem ich das Formular abgeschickt habe,...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
ich habe ein einfaches Formular, welches aus statischen Felder und per JavaScript dynamisch generierten Feldern besteht. Je nach Auswahl, werden verschiedene neue Felder (input, select, textarea etc.) hinzugefügt.<br />
<br />
Mein Problem ist nun das ich, nachdem ich das Formular abgeschickt habe, nicht per $_POST auf die dynamisch generierten Felder zugreifen kann :( .<br />
<br />
Kennt Ihr dieses &quot;Problem&quot; ? Habt Ihr eine Lösung dparat :) ?<br />
<br />
cu<br />
UserNeo</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>UserNeo</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/366006-per-js-dynamische-ipnput-felder-per-_post-abfragen.html</guid>
		</item>
		<item>
			<title>PHPUnit Code Coverage Report ist leer</title>
			<link>http://www.tutorials.de/php/365987-phpunit-code-coverage-report-ist-leer.html</link>
			<pubDate>Tue, 07 Sep 2010 08:55:43 GMT</pubDate>
			<description>Ich habe ein Problem mit PHPUnit. Ich lasse einen Code Coverage Report generieren. Das hat auch mal gut funktioniert, nur wenn ich das jetzt über alle Tests laufen lasse, wird gar kein Report erstellt. Wenn ich das ganze für einen Test mache (egal welcher Test, habe alle durchprobiert), wird immer...</description>
			<content:encoded><![CDATA[<div>Ich habe ein Problem mit PHPUnit. Ich lasse einen Code Coverage Report generieren. Das hat auch mal gut funktioniert, nur wenn ich das jetzt über alle Tests laufen lasse, wird gar kein Report erstellt. Wenn ich das ganze für einen Test mache (egal welcher Test, habe alle durchprobiert), wird immer der Code Coverage Report erstellt. Kennt jemand das Problem oder weiß, wie man das debuggen kann? PHPUnit setze ich in Version 3.4.15 ein, die PHP Version ist PHP 5.2.6 von Debian Lenny.</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>Radhad</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/365987-phpunit-code-coverage-report-ist-leer.html</guid>
		</item>
		<item>
			<title>Backslash in Slash umwandeln</title>
			<link>http://www.tutorials.de/php/365968-backslash-slash-umwandeln.html</link>
			<pubDate>Mon, 06 Sep 2010 15:19:37 GMT</pubDate>
			<description><![CDATA[Hallo, 
 
ich habe eine kleines Programm geschrieben, wo man von seinem Rechner eine Datei angeben muss und diese soll dann in eine DB imporiert werden. 
 
Hier der Code: 
 
 
PHP: 
--------- 
<?php]]></description>
			<content:encoded><![CDATA[<div>Hallo,<br />
<br />
ich habe eine kleines Programm geschrieben, wo man von seinem Rechner eine Datei angeben muss und diese soll dann in eine DB imporiert werden.<br />
<br />
Hier der Code:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP-Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;$server&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$user&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'root'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$passwort&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$database&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'test'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'file'</span><span style="color: #007700">&#93;;<br /><br /><br />&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'senden'</span><span style="color: #007700">&#93;)){<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$newfile&nbsp;</span><span style="color: #007700">=&nbsp;&nbsp;</span><span style="color: #0000BB">str_replace</span><span style="color: #007700">(</span><span style="color: #DD0000">'\\'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'/'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$file&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$newfile</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$verbindung&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$server</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$passwort</span><span style="color: #007700">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #DD0000">"Keine&nbsp;Verbindung&nbsp;m&amp;ouml;glich"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$verbindung</span><span style="color: #007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">mysql_select_db</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #DD0000">"Die&nbsp;Datenbank&nbsp;existiert&nbsp;nicht"</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">=&nbsp;&nbsp;</span><span style="color: #DD0000">"LOAD&nbsp;DATA&nbsp;LOCAL&nbsp;INFILE&nbsp;'$newfile'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INTO&nbsp;TABLE&nbsp;datenfeed<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FIELDS&nbsp;TERMINATED&nbsp;BY&nbsp;';'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ENCLOSED&nbsp;BY&nbsp;''<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LINES&nbsp;TERMINATED&nbsp;BY&nbsp;';'&nbsp;"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$ergebnis&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #DD0000">'DELETE&nbsp;FROM&nbsp;datenfeed&nbsp;WHERE&nbsp;product_id&nbsp;=&nbsp;0'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;</span><span style="color: #0000BB">?&gt;</span>
</span>
</code></code><hr />
</div> <div class="bbcode_container">
	<div class="bbcode_description">HTML-Code:</div>
	<hr /><code class="bbcode_code"> htm<span style="color:#000080">&lt;l&gt;</span><br />
&nbsp;<span style="color:#000080">&lt;body&gt;</span><br />
&nbsp;<span style="color:#FF8000">&lt;form method=<span style="color:#0000FF">&quot;post&quot;</span>&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;table&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;tr&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;td&gt;</span>Dateipfad<span style="color:#008080">&lt;/td&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;td&gt;</span><span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;file&quot;</span> name=<span style="color:#0000FF">&quot;file&quot;</span> /&gt;</span><span style="color:#008080">&lt;/td&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;/tr&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;tr&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;td&gt;</span><span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;submit&quot;</span> name=<span style="color:#0000FF">&quot;senden&quot;</span> value=<span style="color:#0000FF">&quot;Senden&quot;</span>&nbsp; /&gt;</span><span style="color:#008080">&lt;/td&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;/tr&gt;</span><br />
&nbsp;<span style="color:#008080">&lt;/table&gt;</span><br />
&nbsp;<span style="color:#FF8000">&lt;/form&gt;</span><br />
&nbsp;<span style="color:#000080">&lt;/body&gt;</span><br />
&nbsp;<span style="color:#000080">&lt;/html&gt;</span></code><hr />
</div> <br />
Wenn ich die Datei ausgeben lassen möchte zeigt er mir anstatt den vollen Pfad nur die Datei an sich an (webgains_datenfeed.csv) und die Datei wird auch nicht in die DB importiert. Alle teil funktionieren nur nicht diese Funktion :(<br />
<br />
Danke</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>Kalito</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/365968-backslash-slash-umwandeln.html</guid>
		</item>
		<item>
			<title>Addieren von 2 Arrays</title>
			<link>http://www.tutorials.de/php/365941-addieren-von-2-arrays.html</link>
			<pubDate>Sun, 05 Sep 2010 23:55:43 GMT</pubDate>
			<description><![CDATA[Guten Abend! 
 
Bei der Addition, wie im Beispiel zu sehen, erhalte ich den Error: 
 
*Fatal error: Unsupported operand types* 
 
 
PHP: 
--------- 
echo number_format ( $product ["Price"] + $product ["Shipping"], "2", ",", "." );]]></description>
			<content:encoded><![CDATA[<div>Guten Abend!<br />
<br />
Bei der Addition, wie im Beispiel zu sehen, erhalte ich den Error:<br />
<br />
<b><font color="red">Fatal error: Unsupported operand types</font></b><br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP-Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">number_format&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$product&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"Price"</span><span style="color: #007700">&#93;&nbsp;+&nbsp;</span><span style="color: #0000BB">$product&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">"Shipping"</span><span style="color: #007700">&#93;,&nbsp;</span><span style="color: #DD0000">"2"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">","</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"."&nbsp;</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> Ich versuche aber nicht, die Arrays zusammenzufügen, sondern möchte diese addieren. Warum erhalte ich den Error?</div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>Sasser</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/365941-addieren-von-2-arrays.html</guid>
		</item>
		<item>
			<title>Objekt in Array umwandeln</title>
			<link>http://www.tutorials.de/php/365940-objekt-array-umwandeln.html</link>
			<pubDate>Sun, 05 Sep 2010 23:27:19 GMT</pubDate>
			<description><![CDATA[Guten Abend! 
 
Ich habe mir mit Mühe und einigen Beispielen von php.net die folgende Funktion zusammengebaut, welche ein Objekt in ein Array umwandelt. 
 
Mein Problem ist, dass an leeren Stellen korioserweise das Wort "Array" drin steht, anstatt einfach nur leer zu sein. 
 
 
PHP: 
---------...]]></description>
			<content:encoded><![CDATA[<div>Guten Abend!<br />
<br />
Ich habe mir mit Mühe und einigen Beispielen von php.net die folgende Funktion zusammengebaut, welche ein Objekt in ein Array umwandelt.<br />
<br />
Mein Problem ist, dass an leeren Stellen korioserweise das Wort &quot;Array&quot; drin steht, anstatt einfach nur leer zu sein.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP-Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">buildarray</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$array&nbsp;</span><span style="color: #007700">=&nbsp;array&nbsp;();<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">is_object&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$object&nbsp;</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">settype&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$object</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"array"&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #0000BB">$object&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$key&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$value</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;((</span><span style="color: #0000BB">is_array&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;or&nbsp;(</span><span style="color: #0000BB">is_object&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$array&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$key</span><span style="color: #007700">&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">buildarray&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$array&nbsp;</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$key</span><span style="color: #007700">&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">utf8_decode&nbsp;</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$array</span><span style="color: #007700">;<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> </div>

 ]]></content:encoded>
			<category domain="http://www.tutorials.de/php/">PHP</category>
			<dc:creator>Sasser</dc:creator>
			<guid isPermaLink="true">http://www.tutorials.de/php/365940-objekt-array-umwandeln.html</guid>
		</item>
	</channel>
</rss>
