newbie question with MS SQL

newbie question with MS SQL

thashimotothashimoto Posts: 5Questions: 1Answers: 0

I am using MS SQL for the first time and struggle to make it work.
I was able to connect to SQL, but I don't know enough to solve error on ssp.class.php,
line #408 $stmt = $db->prepare( $sql ); //Fatal error: Call to a member function prepare() on a non-object
DataTable live link is below.
http://live.datatables.net/gocorusi/1/edit?html,css,js,console,output
When I was using MySQL, I never had to edit ssp.class.php file.
MS SQL 10.50.2550 on @008 R2 server, PHP 5.4, .dll files installed.
I am a newbie, so take it easy on me, first time posting, and not sure if I enter DataTables live correctly.

Thank you,
-- Toshi

Answers

  • allanallan Posts: 61,880Questions: 1Answers: 10,139 Site admin

    The demo SSP class is not designed to be used with SQL server. Indeed it uses some SQL with is specific to MySQL only. You would need to rewrite the demo code to use MSSQL.

    Regarding the specific error you are seeing - that suggests that $db is probably false, which means your initial database connection failed for some reason.

    Allan

  • thashimotothashimoto Posts: 5Questions: 1Answers: 0
    edited February 2016

    Allan,
    Thank you for reply.
    $db actually picks up

    array(2) {
    [0]=> string(35) "tcp:192.168.3.194\LHBIGBERTHA, 1433"
    [1]=> array(3) {
      ["Database"]=> string(21) "WorldVentures_DEV_OLD"
      ["UID"]=> string(14) "username"
      ["PWD"]=> string(11) "*********" }
    },
    

    that's why I thought there might be workable solution for my case. Thanks again,

    -- Toshi

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • allanallan Posts: 61,880Questions: 1Answers: 10,139 Site admin

    I would have expected $db to be a resource. It looks like it is an array, which is why PHP it giving an error about there being no prepare method.

    Allan

  • DanFDanF Posts: 7Questions: 0Answers: 2
  • thashimotothashimoto Posts: 5Questions: 1Answers: 0

    Dan,

    Thank you very much for sharing your experience, I semi-gave up, and wrote simple query to display table with adding CSS to make it presentable, however there are ton's of challenge ahead of me, sorting table, searchable...etc I had never had this with MySQL.

This discussion has been closed.