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.

Wo ist mein Fehler?

Empfohlene Antworten

Veröffentlicht

Hi,

ich weiß echt net was ich falsch gemacht hab, könnt ihr mal bitte nachschauen. Als Fehler gibt er an, dass die Syntax falsch ist. :rolleyes:

	
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$con = mysql_connect('...','...','´...') or die(mysql_error());

mysql_select_db('...') or die(mysql_error());

$sql="INSERT INTO profil SET (P_ID, P_NAME, P_GEB,P_ORT,P_MAIL,P_INFO)
VALUES (1,'$_POST[real_name]', '$_POST[gebDat]','$_POST[ort]',
'$_POST[mail]','$_POST[info]');


$result= mysql_query($sql) or die(mysql_error());

}

[/PHP]

Vielen Dank.

Ich vermute, daß sich der Fehler in der folgenden Anweisung befindet (habe sie mal ein wenig umformatiert):


$sql = "
INSERT
INTO profil
SET (P_ID, P_NAME, P_GEB, P_ORT, P_MAIL, P_INFO)
VALUES (1, '$_POST[real_name]', '$_POST[gebDat]', '$_POST[ort]', '$_POST[mail]', '$_POST[info]'
);
[/PHP]

Der String wird mit " geöffnet und mit ) geschlossen.

Super, es hat funktioniert. Habe nur die Anführungszeichen am Ende gesetzt.

:upps

Dann ist ja gut.

War noch zu früh am Morgen, was? ;)

Ja, man kommt einfach nicht auf die leichtesten ideen....

jetzt hab ich aber noch ein weiteres problem in meiner sql abfrage.

$con = mysql_connect('localhost','root','') or die(mysql_error());

mysql_select_db('test') or die(mysql_error());


$sql="INSERT INTO profil
SET (P_ID, P_NAME, P_GEB,P_ORT,P_MAIL,P_INFO)
VALUES (1,'".$_REQUEST['real_name']."', '".$_REQUEST['gebDat']."','".$_REQUEST['ort']."',

'".$_REQUEST['mail']."','".$_REQUEST['info']."')";

mysql_query($sql) or die(mysql_error());[/PHP]

Anscheinden kann er die Daten z.B.: '".$_REQUEST['real_name']."' nicht lesen, denn die Felder sind leer bei der Fehlerausgabe.

[b]Fehler: [/b]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(P_ID, P_NAME, P_GEB,P_ORT,P_MAIL,P_INFO) VALUES (1,, , , ,)' at line 2

Wo liegt mein Problem???:rolleyes:

Habs gefunden. Jetzt klappt alles.

Trotzdem vielen Dank. :)

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.