Announcement

Collapse
No announcement yet.

mssql in odbc umwandeln (PHP)

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

  • mssql in odbc umwandeln (PHP)

    Hallo,
    ich habe ein Problem: ich komme neuerdings auf die MSSQL-Datenbank nur noch mit ODBC - habe aber davon nicht viel Ahnung.
    mssql_connect hab ich schon in odbc_connect umgewandelt, (Verbindug steht). Aber was mache ich mit
    Code:
        $startzeit=time();
        mssql_query("TRUNCATE TABLE fwz");
        mssql_query("TRUNCATE TABLE words");
        mssql_query("TRUNCATE TABLE files");
    und
    Code:
    mysql_query("INSERT INTO files(name) VALUES('".mysql_real_escape_string(str_replace($_SERVER['DOCUMENT_ROOT'].'/','',$pdf))."')");
    und
    Code:
    mssql_close();
    Wie setze ich das um?

  • #2
    Hallo eky79,
    Originally posted by eky79 View Post
    Hallo,
    ich habe ein Problem: ich komme neuerdings auf die MSSQL-Datenbank nur noch mit ODBC ...
    Warum?
    Originally posted by eky79 View Post
    Code:
    mysql_query("INSERT INTO files(name) VALUES('".mysql_real_escape_string(str_replace($_SERVER['DOCUMENT_ROOT'].'/','',$pdf))."')");
    Was hat mysql_query mit MSSQL zu tun?

    Gruß Falk
    Wenn du denkst du hast alle Bugs gefunden, dann ist das ein Bug in deiner Denksoftware.

    Quellcode ohne ein Mindestmaß an Formatierung sehe ich mir nicht an! Ich leiste keinen Privatsupport per Mail oder PN!

    Comment


    • #3
      ODBC: wurde bei uns im System geändert. Hab ich leider keinen Einfluss darauf.

      MYSQL: ursprünglich lief es auf einem MYSQL-System. Jetzt sollte es in einem MSSQL-System laufen und auf einmal geht das nur noch mit ODBC. Soweit zum Kauderwelch...

      Gibt es zu meiner Fragestellung Ideen?

      Danke!

      Comment


      • #4
        Originally posted by eky79 View Post
        Gibt es zu meiner Fragestellung Ideen?
        Wie wärs mit dem dem ODBC-Teil vom PHP-Handbuch!?

        mssql_query => odbc_exec
        mssql_close => odbc_close
        ...

        Gruß Falk
        Wenn du denkst du hast alle Bugs gefunden, dann ist das ein Bug in deiner Denksoftware.

        Quellcode ohne ein Mindestmaß an Formatierung sehe ich mir nicht an! Ich leiste keinen Privatsupport per Mail oder PN!

        Comment


        • #5
          Hatte ich schon probiert:
          bei odbc_exec kommt die Fehlermeldung
          Warning: Wrong parameter count for odbc_exec() in
          Woran könnte das liegen? Das ODBC "TRUNCATE TABLE" nicht interpretiern kann?

          Comment


          • #6
            Originally posted by eky79 View Post
            ...bei odbc_exec kommt die Fehlermeldung
            Woran könnte das liegen? Das ODBC "TRUNCATE TABLE" nicht interpretiern kann?
            Nein, das liegt daran das du zu Faul für RTFM bist! Dann wäre dir nämlich aufgefallen, das odbc_exec ZWEI Parameter erwartet (1. eine ConnectionID die z.B. von odbc_connect geliefert wird und 2. den SQL-String)
            mssql_query() verfügt dagegen über 3 Parameter, wobei nur der erste (SQL-String) "Pflicht" ist, die anderen beiden (Verbindungskennung, Stapelgröße) sind optional.

            Gruß Falk
            Wenn du denkst du hast alle Bugs gefunden, dann ist das ein Bug in deiner Denksoftware.

            Quellcode ohne ein Mindestmaß an Formatierung sehe ich mir nicht an! Ich leiste keinen Privatsupport per Mail oder PN!

            Comment

            Working...
            X