Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP MYSQL problem: textfelder

Empfohlene Antworten

Veröffentlicht

Hallo,

Wir wollen per PHP und MYSQL ein Textfeld beschreiben und auslesen.

Funktionieren tut das ganze soweit, nur unser Problem ist, dass wir jedesmal wenn wir nun erneut submiten der neue wert wieder durch den alten überschrieben wird.

Danke schonmal im Vorraus....


$_POST['txf'.$artnmr[$j]] = str_replace(",", ".",$_POST['txf'.$artnmr[$j]]);
$preisNeu[$j] = (float)$_POST['txf'.$artnmr[$j]] *100;
unset($_POST['txf'.$artnmr[$j]] );
var_dump($_POST['txf'.$artnmr[$j]]);
$preis_update = "UPDATE produkte SET preis = $preisNeu[$j] WHERE artikelnummer = $artnmr[$j]";
var_dump($preis_update);
mysql_query($preis_update, $local_produkte) or die(mysql_error());
$grundmengepreis[$j] = (float)($row_Recordset1['preis']/100)
$row_Recordset1['menge'];
$preis[$j] = (float)$row_Recordset1['preis']/100;
$grundmengepreis[$j] = number_format($grundmengepreis[$j],2);
$preis[$j] = str_replace(".", ",",$preis[$j]);
$grundmengepreis[$j] = str_replace(".", ",",$grundmengepreis[$j]);
[/PHP]

--------------------------------------------------

[code] echo '<input type="text" length="6" value="'.$preis[$j].'" onfocus="if(this.value==this.defaultValue)this.value=\'\';" onblur="if(this.value==\'\')this.value=this.defaultValue;"" name="txf'.$artnmr[$j].'"/>€'; [/code]

Moin,


$preis_update = "UPDATE produkte SET preis = $preisNeu[$j] WHERE artikelnummer = $artnmr[$j]";
[/PHP]

Guck mal nach, ob danach in der Variablen die richtigen Werte stehen, also zb gib sie mit echo aus.

Reinhold

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.