Probleme mit SQL Statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Probleme mit SQL Statement

    Hallo zusammen, ich bin dabei für mich ein DB Backup Script zu schreiben. Leider habe ich aber ein Problem, ich bekomme immer einen Fehler

    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 '-dan_dan .gbuch' at line 1

    Nun ich weis nicht ob das vom - her kommt oder nicht. der Codeteil in dem es auftritt heisst.



    PHP Code:
     mysql_query("SHOW CREATE TABLE ".$db.".".$table$link
    Original sollte der obig Fettgemachte Teil so heissen dan-dan_dan

  • #2
    minus-zeichen sind in namen eignetlich nicht erlaubt.

    arbeite mal zur sicherheit mit backticks
    PHP Code:
    [pph]mysql_query("SHOW CREATE TABLE `".$db."`.`".$table."`"$link); 
    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


    Comment


    • #3
      Danke so funktioniert es einwandfrei. Danke

      Comment

      Working...
      X