Home | Registrieren | Einloggen | Suchen | Aktuelles


Forum » PHP & MySQL » auslesen aus DB funkt nicht! Antworten
auslesen aus DB funkt nicht!

brali
Feiertags-Poster


Beiträge: 37


Hallo zusammen,

kleines Problem, ich habe ein script geschrieben in dem ich Kunden verwalten kann Rechnungen etc.
Nun zu meinem Problem.

Alle kundendaten werden aus der DB ausgelesen und angezeigt. Nun habe ich hinter jeden Datensatz einen Link zum: "Bearbeiten | löschen | email | Admin senden" gesetzt.
das löschen das email senden und das Admin senden funktioniert auch wunderbar.
nur das bearbeiten nicht.
jedesmal wenn ich auf bearbeiten klicke, ließt er und zeigt mir den letzten datensatz aus der Datenbank an. egal weclhen kunden ich auswähle.

Bitte vezeiht mir für den langen code, aber ich komme wirklich nicht weiter.
ist bestimmt was ganz triviales, aber man sieht den wald vor lauter bäumen nicht mehr.

Hier der code:

Kunden_anzeigen
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:
<?
require  ("config/config.php");
require  ("config/sub_config.php");
require  ("config/globals.php");
?>
<head>
<LINK href="style/kv.css" type=text/css rel=stylesheet>
<base target="_self">
</head>
<body bgcolor="#436474">
<p><font color="#FFFFFF" face="Verdana" size="2"><b>Kunden anzeigen</b></font></p>
<table border="0" width="100%">
	<tr>
	<td width=12>&nbsp;</td>
	</tr>
</table>
<? 
$abfrage = "SELECT * from kundendaten";
echo <<<ELS
<table border=0  width=50%>
<tr>
<td bgcolor=cc99cc width=100><font color=#FFFFFF><b>Kundennummer</b></font></td>
<td bgcolor=cc99cc><font color=#FFFFFF><b>Vorname</b></font></td>
<td bgcolor=cc99cc><font color=#FFFFFF><b>Nachname</b></font></td>
<td bgcolor=cc99cc><font color=#900000><b>Bearbeiten</b></font></td>
</tr>
ELS;

$result = mysql_query($abfrage,$verbindung);
while ($row = mysql_fetch_array($result)) 
{
$kdnr = $row["kdnr"];
$vorname = $row["vorname"];
$nachname = $row["nachname"];
$email = $row["email"];
echo <<<AUT
	<tr>
	<td bgcolor=#ffffff><font color=#436474><b>$kdnr</b></font></td>
	<td bgcolor=#ffffff><font color=#436474>$vorname</font></td>
	<td bgcolor=#ffffff><font color=#436474>$nachname</font></td>
	<td bgcolor=#ffffff><a target=Hauptframe href=kunden_ansehen.php?action=bearb&kdnr=$kdnr&nachname=$nachname><img border=0 src=../images/but_art.gif width=18 height=14 alt=bearbeiten></a> | <a href=kunden_ansehen.php?action=del&kdnr=$kdnr&nachname=$nachname><img border=0 src=../images/delete.gif width=14 height=13 alt=löschen></a> | <a href=mailto:$email><img border=0 src=../images/mail.gif width=15 height=16 alt=emailsenden></a> | <a href=kunden_ansehen.php?action=send&kdnr=$kdnr&nachname=$nachname><img border=0 src=../images/admin.gif width=20 height=14 alt="Fehler melden"></a></td>
	</tr>
AUT;
}

echo"</table>";
mysql_free_result($result);
mysql_close($verbindung);
?>
<? if (!$action) $action = "red";
include($action.".inc.php"); ?>
</body>

</html>


Hier der code zum bearbeiten:
bearb.inc.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: 
169: 
170: 
171: 
172: 
173: 
174: 
175: 
176: 
177: 
178: 
179: 
180: 
181: 
182: 
183: 
184: 
185: 
186: 
187: 
188: 
189: 
190: 
191: 
192: 
193: 
194: 
195: 
196: 
197: 
198: 
199: 
200: 
201: 
202: 
203: 
204: 
205: 
206: 
207: 
208: 
209: 
210: 
211: 
212: 
213: 
214: 
215: 
216: 
217: 
218: 
219: 
220: 
221: 
222: 
223: 
224: 
225: 
226: 
227: 
228: 
229: 
230: 
231: 
232: 
233: 
234: 
235: 
236: 
237: 
238: 
239: 
240: 
241: 
242: 
243: 
244: 
245: 
246: 
247: 
248: 
249: 
250: 
251: 
252: 
253: 
254: 
255: 
256: 
257: 
258: 
259: 
260: 
261: 
262: 
263: 
264: 
265: 
266: 
267: 
268: 
269: 
270: 
271: 
272: 
273: 
274: 
275: 
276: 
277: 
278: 
279: 
280: 
281: 
282: 
283: 
284: 
285: 
286: 
287: 
288: 
289: 
290: 
291: 
292: 
293: 
294: 
295: 
296: 
297: 
298: 
299: 
300: 
301: 
302: 
303: 
304: 
305: 
306: 
307: 
308: 
309: 
310: 
311: 
312: 
313: 
314: 
315: 
316: 
317: 
318: 
319: 
320: 
321: 
322: 
323: 
324: 
325: 
326: 
327: 
328: 
329: 
330: 
331: 
332: 
333: 
334: 
335: 
336: 
337: 
338: 
339: 
340: 
341: 
342: 
343: 
344: 
345: 
346: 
347: 
348: 
349: 
350: 
351: 
352: 
353: 
354: 
355: 
356: 
357: 
358: 
359: 
360: 
361: 
362: 
363: 
364: 
365: 
366:
<?
require  ("config/config.php");
require  ("config/sub_config.php");
require  ("config/globals.php");
?>
<html>
<head>
<LINK href="style/kv.css" type=text/css rel=stylesheet>
<base target="_self">
</head>
<body bgcolor="#436474">
<form action="kunden_ansehen.php?action=bearb1" method="POST">
<p><font color="#FFFFFF" face="Verdana" size="2"><b>Kunden ändern</b></font></p>
<b><font color="#FFFFFF" size="1" face="Verdana">Alle Felder mit * sind Pflichtfelder 
!!!</font></b><table border="0" width="100%" id="table1">
<?
include("config/config.php");
$abfrage = "SELECT * from kundendaten where kdnr='$kdnr' and nachname='$nachname'";
$ergebnis = mysql_query($abfrage);
while ($row = mysql_fetch_array ($ergebnis))
{
$kdnr = $row["kdnr"];
$anrede = $row["anrede"];
$firma = $row["firma"];
$vorname = $row["vorname"];
$nachname = $row["nachname"];
$strasse = $row["strasse"];
$postleitzahl = $row["postleitzahl"];
$wohnort = $row["wohnort"];
$telefon = $row["telefon"];
$telefax = $row["telefax"];
$email = $row["email"];
$webspace = $row["webspace"];
$domainname = $row["domainname"];
$bemerkungen = $row["bemerkungen"];
$kreditinstitut = $row["kreditinstitut"];
$bankleitzahl = $row["bankleitzahl"];
$kontonummer = $row["kontonummer"];

echo <<<END
echo $kontonummer
echo $vorname
<tr>

		<td colspan="2"></td>

	</tr>

	<tr>

		<td width="20%" bgcolor="#CC99CC"><i><b>Kundendaten</b></i></td>

		<td width="79%" bgcolor="#CC99CC">

					</td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Anrede</font></td>

		<td width="79%">

					
					<p>
						<select size="1" name="Anrede" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; border: 1px solid #436474; background-color: #000000">
						<option selected>$anrede</option>
						<option>Herr</option>
						<option>Frau</option>
						<option>Firma</option>
						</select></p></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Firma</font></td>

		<td width="79%">

					<input type="text" name="Firma" value="$firma" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Vorname*</font></td>

		<td width="79%">

				<input type="text" name="Vorname" value="$vorname" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>
	<tr>

		<td width="20%"><font color="#FFFFFF">Nachname*</font></td>

		<td width="79%">

					<input type="text" name="Nachname" value="$nachname" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Straße*</font></td>

		<td width="79%">

					<input type="text" name="Strasse" value="$strasse" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">PLZ, Ort*</font></td>

		<td width="79%">

					<input type="text" name="PLZ" value="$postleitzahl" size="6" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333">

					<input type="text" name="Ort" value="$wohnort" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Telefon*</font></td>

		<td width="79%">

					<input type="text" name="Telefon" values="$telefon" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Telefax</font></td>

		<td width="79%">

					<input type="text" name="Telefax" value="$telefax" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">E-Mail*</font></td>

		<td width="79%">

					<input type="text" name="Email" value="$email" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%" bgcolor="#CC99CC"><i><b>Domaindaten</b></i></td>

		<td width="79%" bgcolor="#CC99CC">

					

						&nbsp;</td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Webspace*</font></td>

		<td width="79%">

					

						<p>

						<select size="1" name="$webspace" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; border: 1px solid #436474; background-color: #000000">
						<option>Server1</option>
						<option>Server2</option>
						<option>Server3</option>
						</select></p>

				

</td>

	</tr>

	<tr>

		<td width="20%"></td>

		<td width="79%">

					</td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Domainname/n*</font><p>&nbsp;</td>

		<td width="79%">

						<textarea rows="3" name="$domainname" cols="36" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333">http://www.xxx.xx</textarea></td>

	</tr>

	<tr>

		<td width="20%" bgcolor="#CC99CC"><i><b>Bankdaten</b></i></td>

		<td width="79%" bgcolor="#CC99CC">

					&nbsp;</td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Bank*</font></td>

		<td width="79%">

					<input type="text" name="$kreditinstitut" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Kontonummer*</font></td>

		<td width="79%">

					<input type="text" name="$kontonummer" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Bankleitzahl*</font></td>

		<td width="79%">

					<input type="text" name="$bankleitzahl" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Kontoinhaber*</font></td>

		<td width="79%">

					<input type="text" name="Kontoinhaber" size="20" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></td>

	</tr>

	<tr>

		<td width="20%" bgcolor="#CC99CC"><i><b>Bemerkungen</b></i></td>

		<td width="79%" bgcolor="#CC99CC">

					&nbsp;</td>

	</tr>

	<tr>

		<td width="20%"><font color="#FFFFFF">Bemerkungen</font><p>&nbsp;</td>

		<td width="79%">

						<textarea rows="3" name="$bemerkungen" cols="36" style="font-family: Verdana; font-size: 8pt; color: #FFFFFF; background-color: #333333"></textarea></td>

	</tr>

	<tr>

		<td width="20%"></td>

		<td width="79%">

					</td>

	</tr>

	<tr>

		<td width="20%"></td>

		<td width="79%">

					</td>

	</tr>

	<tr>

		<td width="20%">&nbsp;</td>

		<td width="79%">

					&nbsp;</td>

	</tr>

	<tr>

		<td width="20%">&nbsp;</td>

		<td width="79%">

					&nbsp;</td>

	</tr>

	<tr>

		<td width="20%">&nbsp;</td>

		<td width="79%">

								&nbsp;</td>

	</tr>

	<tr>

		<td width="20%"></td>

		<td width="79%">
	<input type="submit" value="Kunden anlegen" name="anleg">
	</form></td>
END;
}
mysql_free_result($ergebnis);
mysql_close($verbindung);
?>
	</tr>
	<tr>
		<td width="20%"></td>
	<td width="79%">
					</td>
	</tr>
	<tr>
		<td width="20%"></td>
		<td width="79%">
					</td>
	</tr>
	<tr>
		<td width="20%"></td>
		<td width="79%">
		&nbsp;</td>
	</tr>
	<tr>
		<td width="20%"></td>
		<td width="79%">
									</td>
	</tr>
</table>
</body>
</html>


greetz brali


---
-= Das Menschliche an Computern ist ihre Gewissenlosigkeit =-

  Profil   Editieren   Zitieren

Philipp Gérard
Foren-Team


Beiträge: 1508


zeile 18, bearb.inc.php: sind das superglbals oder müsstest du da nicht mit $_POST['kdnr'] usw. drauf zugreifen?

---
Arbeit ist das Feuer der Gestaltung. - Marx

  Profil   E-Mail   Website   Editieren   Zitieren

brali
Feiertags-Poster


Beiträge: 37


hi,

eigentlich sind das globals.
deswegen verstehe ich es ja nicht



---
-= Das Menschliche an Computern ist ihre Gewissenlosigkeit =-

  Profil   Editieren   Zitieren

brali
Feiertags-Poster


Beiträge: 37


Danke, Problem behoben.

das Script hat zwar alle werte übergeben, könnte sie aber nicht auflösen.
habe nun alle weiteren scriptdaten .inc.php genannt (alle includiert) und nun funktioiert es.

THX
brali

---
-= Das Menschliche an Computern ist ihre Gewissenlosigkeit =-

  Profil   Editieren   Zitieren
 

Antworten
Nach oben