data in database a.d.h.v ID
Voor een nieuwe vraag -> nieuw topic :)
Code (php)
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
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
<?PHP
$string = file("textStats.mhtml");
$time = time();
$time2 = ereg_replace("Updated ","",$string[0]);
$uitkomst = round(($time-$time2)/60,2);
echo "Laatste update was ".$uitkomst." minuten geleden<br>";
$sliced_string =array_slice($string,2);
foreach ($sliced_string as $line_num => $line) {
$line = ereg_replace(" "," ", $line);
$exploded_newline = explode("<br>", $line);
foreach ($exploded_newline as $exploded_num => $exploded_line)
{
if(ereg("^Team", $exploded_line)){
$exploded_space = explode(" ", $exploded_line);
foreach ($exploded_space as $exploded_space_num => $exploded_space_line){
switch($exploded_space_num)
{
case 0:
break;
case 1:
echo "id:".$exploded_space_line." ";
break;
case 2:
echo "teamnaam:".$exploded_space_line." ";
break;
case 3:
echo "startdatum:".$exploded_space_line." ";
break;
case 4:
echo "id:".$exploded_space_line." ";
break;
case 5:
echo "tot.tests:".$exploded_space_line." ";
break;
case 6:
echo "tests vandaag:".$exploded_space_line." ";
break;
case 7:
echo "currently pending:".$exploded_space_line." ";
break;
case 8:
echo "tot cEMS:".$exploded_space_line." ";
break;
case 9:
echo "cEMS vandaag:".$exploded_space_line." ";
break;
case 10:
echo "";
break;
case 11:
echo "<br>";
break;
}
}
}
else {
echo "user:".$exploded_line."<br>";
}
}
}
?>
$string = file("textStats.mhtml");
$time = time();
$time2 = ereg_replace("Updated ","",$string[0]);
$uitkomst = round(($time-$time2)/60,2);
echo "Laatste update was ".$uitkomst." minuten geleden<br>";
$sliced_string =array_slice($string,2);
foreach ($sliced_string as $line_num => $line) {
$line = ereg_replace(" "," ", $line);
$exploded_newline = explode("<br>", $line);
foreach ($exploded_newline as $exploded_num => $exploded_line)
{
if(ereg("^Team", $exploded_line)){
$exploded_space = explode(" ", $exploded_line);
foreach ($exploded_space as $exploded_space_num => $exploded_space_line){
switch($exploded_space_num)
{
case 0:
break;
case 1:
echo "id:".$exploded_space_line." ";
break;
case 2:
echo "teamnaam:".$exploded_space_line." ";
break;
case 3:
echo "startdatum:".$exploded_space_line." ";
break;
case 4:
echo "id:".$exploded_space_line." ";
break;
case 5:
echo "tot.tests:".$exploded_space_line." ";
break;
case 6:
echo "tests vandaag:".$exploded_space_line." ";
break;
case 7:
echo "currently pending:".$exploded_space_line." ";
break;
case 8:
echo "tot cEMS:".$exploded_space_line." ";
break;
case 9:
echo "cEMS vandaag:".$exploded_space_line." ";
break;
case 10:
echo "";
break;
case 11:
echo "<br>";
break;
}
}
}
else {
echo "user:".$exploded_line."<br>";
}
}
}
?>
De bedoeling is om in die while lus de gegevens die daar worden getoond eigenlijk om te vormen zodat die gegevens in een database worden geplaatst (teams onder de tabel team en users onder de tabel users)
Maar nu moeten die gegevens van dat team opgeslagen worden in hetzelfde veld zodat ze samen blijven
Bv:
TEAM
--------
teamid.........naam.........total cEMS
12...............john doe.....9,5T
Hoe kan ik dit het efficientst mogelijk doen?
mvg,
dizzy
Gewijzigd op 01/01/1970 01:00:00 door Dizzy
Er zijn nog geen reacties op dit bericht.