SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: MSSQL error

  1. #1
    SitePoint Evangelist tangledman's Avatar
    Join Date
    Sep 2005
    Location
    Puerto de Mazarron, Murcia, Spain
    Posts
    426
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MSSQL error

    Hi there I am getting the follwoing error and I am not sure what the error means...can anyone help?

    Thanks

    Warning: mssql_query() [function.mssql-query]: message: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16) in C:\Inetpub\wwwroot\zycko_2007\06\admin\cms2.php on line 7

    Warning: mssql_query() [function.mssql-query]: Query failed in C:\Inetpub\wwwroot\zycko_2007\06\admin\cms2.php on line 7

    Warning: mssql_fetch_assoc(): supplied argument is not a valid MS SQL-result resource in C:\Inetpub\wwwroot\zycko_2007\06\admin\cms2.php on line 9


    PHP Code:
    <? 
    session_start
    ();

    include 
    "../../connect.inc.php";

    $query="SELECT * FROM zycko_products.dbo.cms_pages";
    $result=mssql_query($query);

    while (
    $array=mssql_fetch_assoc($result)) {

    echo 
    $array['domain']."<br>";

    }

    ?>

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi, Have a look at http://php.net/manual/en/function.mssql-query.php and sepcifically the user notes:
    Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library

    solution:
    try: select field from table, avoid "select * from table" php will scream at you. strangely after executing select field from table you'll be able to execute select * from table.

    i'm using apache2, win XP, sqlexpress05
    Doing a select * for anything is a massive no no - select the fields you want not the whole caboodle!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Evangelist tangledman's Avatar
    Join Date
    Sep 2005
    Location
    Puerto de Mazarron, Murcia, Spain
    Posts
    426
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there I tried this and it still produces the same error, even when I just select the field I am interested in.

    PHP Code:
    <? 
    session_start
    ();

    include 
    "../../connect.inc.php";

    $query="SELECT content  FROM zycko_products.dbo.cms_pages";
    $result=mssql_query($query);

    while (
    $array=mssql_fetch_assoc($result)) {

    echo 
    $array['content']."<br>";

    }

    ?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •