Visualizzazione dei risultati da 1 a 2 su 2

Discussione: T-SQL e php

  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2006
    Messaggi
    260

    T-SQL e php

    Salve raga,
    Vorrei sapere se si possono utilizzare query T-SQL per SQL Server 2005 su php, ho provato a fare:
    Codice PHP:
    <?php
    $myServer 
    "ANGELO\\SQLEXPRESS"
    $myUser ""
    $myPass ""

    $s mssql_connect($myServer$myUser$myPass
    or die(
    "Non è stato possibile connettere il server $myServer"); 


    $query "USE master

    GO

    CREATE DATABASE Sales

    ON 

    ( NAME = 'Sales_dat',

      FILENAME = 'C:\\webserver angelo\\database\\saledat.mdf',

      SIZE = 10,

      MAXSIZE = 50,

      FILEGROWTH = 5 )

    LOG ON

    ( NAME = 'Sales_log',

      FILENAME = 'C:\\webserver angelo\\database\\salelog.ldf',

      SIZE = 5MB,

      MAXSIZE = 25MB,

      FILEGROWTH = 5MB )

    GO"
    ;

    mssql_query($query); 

    ?>

    Ma non và

    Fatemi sapere
    BUON NATALE

  2. #2
    Utente di HTML.it
    Registrato dal
    Feb 2006
    Messaggi
    260
    Ho corretto così, togliendo i "GO" e funziona
    Codice PHP:
    $query "USE master

    CREATE DATABASE Sales

    ON 

    ( NAME = 'Sales_dat',

      FILENAME = 'C:\webserver angelo\database\saledat.mdf',

      SIZE = 10,

      MAXSIZE = 50,

      FILEGROWTH = 5 )

    LOG ON

    ( NAME = 'Sales_log',

      FILENAME = 'C:\webserver angelo\database\salelog.ldf',

      SIZE = 5MB,

      MAXSIZE = 25MB,

      FILEGROWTH = 5MB )

    "

    Perkè php non vuole le istruzioni GO?

    Grazie mille

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.