php.de

Zurück   php.de > Webentwicklung > Datenbanken

Datenbanken SQL und Co

Antwort
 
LinkBack Themen-Optionen Thema bewerten
Alt 27.05.2005, 12:45  
Gast
 
Beiträge: n/a
Standard [Erledigt] #1064 - You have an error in your SQL syntax.

Wenn ich eine MySQL Tabelle aufrufen will kommt immer :
Code:
"#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax"
Kann mir jemand helfen?
  Mit Zitat antworten
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 27.05.2005, 12:50  
Erfahrener Benutzer
 
Registriert seit: 29.10.2004
Beiträge: 1.783
derHund
Standard

ja, sicher kann jemand helfen. nur so wird es keiner tun.

- man kann keine sql-tabelle aufrufen
- wie lautet die abfrage?
- wie lautet die vollständige fehlermeldung?
__________________
derHund ist offline   Mit Zitat antworten
Alt 27.05.2005, 13:06  
Gast
 
Beiträge: n/a
Standard

Ich hab bei phpmyadmin versuch auf die Datenbank anzuschauen (mit :
PHP-Code:
<?php
SELECT 

FROM 'User'
LIMIT 0 30 
?>
Und es kommt:
Code:
#1064 - 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 ''User' Limit 0,30' at line 1

Kann mir vielleich jetzt jemand helfen?
  Mit Zitat antworten
Alt 27.05.2005, 13:07  
Erfahrener Benutzer
 
Registriert seit: 01.12.2003
Beiträge: 4.113
supertramp
Standard

ja. hier im Forum sind ein paar links in einem festgetackerten thread. Da ist auch einer von www.schattenbaum.net Dort wird erklärt, wie du mit SQL um gehen kannst.

SO jedenfalls weiß PHP damit nichts anzufangen!
__________________
Aufstrebend, kompetent und werbefrei.
www.developers-guide.net
supertramp ist offline   Mit Zitat antworten
Alt 27.05.2005, 13:17  
Gast
 
Beiträge: n/a
Standard

Ich hab auch ein richtiges PHP programm geschrieben aber das klappt auch nicht, obwohl ich ein Buch (von Galileo Computing) habe, in dem es genauso gemacht wird.
PHP-Code:
<?php
   $Name
=$_POST['Name'];
   
$Passwort=$_POST['Passwort'];
   
$Email=$_POST['Email']       ;
   
$Nickname=$_POST['Nickname'];
   
   
   
mysql_connect("localhost","---------","------") ;
   
mysql_select_db("davidspy1000")               ;
   
   
$sqlab="insert login (Name,Nickname,Passwort,Reg,Email) values ('";
   
$sqlab.= "$Name','$Nickname','$Passwort','User','$Email')";
   
mysql_query ($sqlab);
    
$num =mysql_affected_rows()  ;
    if (
$num>0)     {
       echo 
"Sie wurden erfolgreich bei [url]www.dasp1000.de.vu[/url] angemeldet.Sie kriegen Ihre Zugangsdaten zugeschickt.";
 }
    else   {
        echo 
"Fehler bei der Anmeldung.";
    }
   
   
   
  
?>
  Mit Zitat antworten
Alt 27.05.2005, 13:44  
Erfahrener Benutzer
 
Registriert seit: 14.01.2004
Beiträge: 2.543
fantast
fantast eine Nachricht über ICQ schicken
Standard

tabellennamen stehen in backticks nicht in anfuehrungszeichen.
__________________
Was ist validität?
fantast ist offline   Mit Zitat antworten
Alt 27.05.2005, 13:47  
Gast
 
Beiträge: n/a
Standard

d.h.
einfache Anführungszeichen: 'Zeichenkette'
backticks: `Name`
  Mit Zitat antworten
Alt 27.05.2005, 14:12  
Gast
 
Beiträge: n/a
Standard

Danke! Jetzt klappts.
  Mit Zitat antworten
Alt 27.05.2005, 14:13  
Erfahrener Benutzer
 
Registriert seit: 25.02.2004
Beiträge: 1.524
Orolhawion
Standard

ergänzend: mysql_error() ist auch was feines...
http://www.php.net/mysql_error
__________________
"die Mitte des Textes kann ja theor. mitten in einem Text liegen"

http://www.jagr.de/
Orolhawion ist offline   Mit Zitat antworten
Antwort


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
wie müsste die korrekte Syntax sein? dh1sbg Datenbanken 2 06.05.2008 21:45
Fehlermeldung You have an error in your SQL syntax; check... blu21 Datenbanken 2 18.09.2006 15:34
You have an error in your SQL syntax near PHP Tipps 2005-2 1 06.10.2005 21:55
[solved] Parse-Fehler bei INSERT INTO Datenbanken 19 15.08.2005 13:56
komm bei der Syntax nicht mehr weiter PHP Tipps 2005-2 3 03.08.2005 18:09
[Solved] MySQL Anfrage Fehler :: (1064) PHP Tipps 2005-2 3 02.08.2005 09:46
[Erledigt] Falscher Syntax? Datenbanken 2 31.07.2005 23:39
#1064 bei export von mysql 4.0.20 auf 4.0.24 per phpmyadmin Datenbanken 2 15.06.2005 15:41
Bei Datenbankabfrage kommt 'You have an error in your SQL .' PHP Tipps 2005 3 01.02.2005 17:51
[Erledigt] Probleme mit Delete Syntax Datenbanken 6 27.12.2004 12:07
You have an error in your SQL syntax Creativ Datenbanken 1 20.10.2004 16:00
Is your Son a Computer Hacker?? Off-Topic Diskussionen 8 10.09.2004 20:00
DB aus 3.x in 4.x importieren - Fehler #1064 Schaelle Datenbanken 3 05.08.2004 13:04
You have an error in your SQL PHP Tipps 2004 11 16.06.2004 14:24

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
1064 - you have an error in your sql syntax, 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, #1064 - 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, #1064 - you have an error in your sql syntax;, #1064 - you have an error in your sql syntax, #1064 - 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 \'\' at line 2, mysql 1064 you have an error in your sql syntax, 1064 you have an error in your sql syntax, 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 \'\' at line 1, 1064 - 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, you have an error in your sql syntax, #1064 - 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 \'\' at line 1, 1064 you have an error in your sql syntax check the manual that corresponds to your mysql server, check the manual that corresponds to your mysql server version for the right syntax to use near, 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 \', 1064 - you have an error in your sql syntax;, #1064 - 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 \', 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 \'\' at line 3, 1064: 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, #1064 - you have an error in your sql syntax; check the manual that corresponds to your mysql server version

Alle Zeitangaben in WEZ +1. Es ist jetzt 16:20 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.