Statistik |
Beiträge: 144.531 (Täglich: 19,19 )
Themen: 16.700
Mitglieder: 13.209
Neuestes Mitglied: zitronentee.
Ausl. d. letzten Minute: 328%
Ausl. d. letzten 5 Minuten: 346%
Ausl. d. letzten 15 Minuten: 276%
Aktulle Uhrzeit: 20:54
Freier Webspace: 4.04 TB
PHP-Version: 7.4.33
|
|
|
|
|
Dropdown Werte übergeben |
|
Hallo,
habe mir ein Dropdown Feld gebastelet und möchte jetzt einen Datum auswählen.
Die Felder (v_Datum) von Datum und (b_Datum) bis Datum sind im DATE -Format.
Wie muß ich die Dropdown deklarieren damit ich die Werte übergeben kann?
Dorpdown ist gesplittet und sieht so aus:
22 Dezember 2005
Als Selektion bei der Ausgabe habe ich folgenden Select:
php: |
1:
2:
3:
4:
|
include("connect.php");
$sqlab = "select id, DATE_FORMAT(v_Datum, '%d.%m.%Y')datum FROM event WHERE datum BETWEEN " . (int) $_POST['v_Datum'] . " AND " . (int) $_POST['b_Datum'] ;
$res = mysql_query($sqlab); |
|
|
|
27.12.2005 18:40 |
|
|
headloose
Routinier
Dabei seit: 19.12.2005
Beiträge: 357
0 Filebase-Einträge
Alter: 65 Jahre
Herkunft: Baden Württemberg
Bewertung:
Level: 41 [?]
Erfahrungspunkte: 2.382.710
Nächster Level: 2.530.022
Themenstarter
|
|
Hallo,
ja ich habe mehrere Dropdownfelder. Eines für den Tag, Monat, hier allerdings (Januar, Februar, usw...) und Jahr.
Wie kann ich das zuSammenbasteln?
|
|
27.12.2005 21:21 |
|
|
Viktor
Administrator
Zeige Viktor auf Karte
Dabei seit: 15.08.2003
Beiträge: 31.570
363 Filebase-Einträge
Alter: 66 Jahre
Herkunft: NRW wBB-Version: wBB2.3 PHP-Version: 7.4.33 MySQL-Version: 10.5.19-MariaDB Wo bist du gehostet?: eigener Server
Bewertung:
Level: 71 [?]
Erfahrungspunkte: 237.757.098
Nächster Level: 266.777.854
|
|
|
27.12.2005 22:32 |
|
|
headloose
Routinier
Dabei seit: 19.12.2005
Beiträge: 357
0 Filebase-Einträge
Alter: 65 Jahre
Herkunft: Baden Württemberg
Bewertung:
Level: 41 [?]
Erfahrungspunkte: 2.382.710
Nächster Level: 2.530.022
Themenstarter
|
|
... ok, habe ich verstanden
komme trotzdem noch nicht so recht weiter!
Mir fehlt es einfach noch an Kenntnisse.
Ich muß doch bestimmt meine Dropdownfelder mitteilen was nun ein Tag ist ein Monat ist und Jahr ist oder?
Ich zeige Dir mal das Script wie derzeit mit Deinen Zeilen steht:
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:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
|
table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form name="form1" method="post" action="zeige.php">
<table width="65%" border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="middle">
<td width="10%"><select name="vDatum" id="v_Datum">
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select></td>
<td width="15%"><select name="vDatum" id="v_Datum">
<option>Januar</option>
<option>Februar</option>
<option>März</option>
<option>April</option>
<option>Mai</option>
<option>Juni</option>
<option>Juli</option>
<option>August</option>
<option>September</option>
<option>Oktober</option>
<option>November</option>
<option>Dezember</option>
</select></td>
<td width="12%"><select name="vDatum" id="v_Datum">
<option selected>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
</select></td>
<td width="1%"> </td>
<td width="9%"><select name="bDatum" id="b_Datum">
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select></td>
<td width="15%"><select name="bDatum" id="b_Datum">
<option>Januar</option>
<option>Februar</option>
<option>März</option>
<option>April</option>
<option>Mai</option>
<option>Juni</option>
<option>Juli</option>
<option>August</option>
<option>September</option>
<option>Oktober</option>
<option>November</option>
<option>Dezember</option>
</select></td>
<td width="11%"><select name="bDatum" id="b_Datum">
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
</select></td>
<td width="27%"><input type="submit" name="Submit" value="Veranstaltungen"></td>
</tr>
<tr align="center" valign="middle">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form></td>
</tr>
</table>
<?php
include("connect.php");
$sqlab = "select id, DATE_FORMAT(vDatum, '%d.%m.%Y')vDatum, bDatum, Veranstaltungstitel, Veranstaltungsort from event ORDER BY vDatum ASC LIMIT 0,15";
$res = mysql_query($sqlab);
$vdatum = $vyear.'-'.(($vmonth < 10) ? ('0') : ('')).$vmonth.'-'.(($vday < 10) ? ('0') : ('')).$vday;
$bdatum = $byear.'-'.(($bmonth < 10) ? ('0') : ('')).$bmonth.'-'.(($bday < 10) ? ('0') : ('')).$bday;
// Tabellenbeginn
echo "<table border=0 cellpadding=5 cellspacing=0>";
// Ãœberschrift
echo "<tr>Alle Veranstaltungen ab: " .$name.", den ".$tag.". ".$monat." ".$jahr. "</tr>";
echo "<tr><td width=120 bgcolor=#EFEFEF>Datum</td><td width=290 bgcolor=#EFEFEF>Veranstaltung</td><td width=120 bgcolor=#EFEFEF>Veranstaltungsort</td>";
while ($dsatz = mysql_fetch_assoc($res))
{
echo "<tr>";
echo "<td width=120><a href='detail.php?id=".$dsatz["id"]."' >" . $dsatz["vDatum"] . "</a></td>";
echo "<td width=290>" . $dsatz["Veranstaltungstitel"] . "</td>";
echo "<td width=120>" . $dsatz["Veranstaltungsort"] . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=120 height=1 bgcolor=#2E689F></td>";
echo "<td width=290 height=1 bgcolor=#2E689F></td>";
echo "<td width=120 height=1 bgcolor=#2E689F></td>";
echo "</tr>";
}
// Tabellenende
echo "</table>";
mysql_close($verbindung);
?>
|
|
|
|
27.12.2005 22:57 |
|
|
Viktor
Administrator
Zeige Viktor auf Karte
Dabei seit: 15.08.2003
Beiträge: 31.570
363 Filebase-Einträge
Alter: 66 Jahre
Herkunft: NRW wBB-Version: wBB2.3 PHP-Version: 7.4.33 MySQL-Version: 10.5.19-MariaDB Wo bist du gehostet?: eigener Server
Bewertung:
Level: 71 [?]
Erfahrungspunkte: 237.757.098
Nächster Level: 266.777.854
|
|
|
27.12.2005 23:27 |
|
|
headloose
Routinier
Dabei seit: 19.12.2005
Beiträge: 357
0 Filebase-Einträge
Alter: 65 Jahre
Herkunft: Baden Württemberg
Bewertung:
Level: 41 [?]
Erfahrungspunkte: 2.382.710
Nächster Level: 2.530.022
Themenstarter
|
|
... ja ich weiss das es schon etwas schwierig ist mit php.
Aber ich befasse mich erst seit ca. zwei Wochen mit php. Habe mir zwar Bücher angeschafft, aber die Praxis ist mir einfach lieber zum verstehen.
Trotzdem vielen Dank für Deine Hilfe.
Irgendwo ist noch der Haken drin. Habe die Parameter abgeändert im Monat wie Du es beschrieben hast, geht aber immer noch nicht.
Ich werde jetzt erst mal abschalten und morgen nochmal nachschauen.
Ausser Du hast noch einen Tipp!
|
|
27.12.2005 23:46 |
|
|
|
|
|
|