Announcement

Collapse
No announcement yet.

Using MYSQL/PHP from sellerdeck software

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

    Using MYSQL/PHP from sellerdeck software

    Hi,

    I am currently trying to connect from a layout inside sellerdeck software to a mysql database online.

    Now I have just discovered that I can use PHP inside sellerdeck, I have then tried to connect to mysql.. but keep getting -- Fatal Error : Class 'mysqli' not found.


    Does this mean that there is no module for mysql installed with the sellerdeck software, or is there another way to connect?


    Is there any way I can install the php/mysql module myself ?


    Any advice greatly appreciated

    #2
    Hi,

    I am no expert but your error is referring to MySQLi which is different to MySQL.

    You probably need to get your webhost to install MySQLi or just make sure you are only using MySQL.

    Hope this helps.

    Peter
    Printerbase - Colour & Mono Laser Printers

    Comment


      #3
      Mysqli is just a class that can query MYSql Databases

      Comment


        #4
        Originally posted by STSO-UK View Post
        Mysqli is just a class that can query MYSql Databases
        Yes but the problem lies within the PHP code not with Sellerdeck. Sellerdeck produces HTML pages into which you can embed PHP calls to the host. The host runs the php code and returns the results or errors, you have a problem with the PHP on your host server that does not support msqli library.

        I use PHP and MySql extensively for custom Sellerdeck projects incorporating new functions ito Sellerdeck such as routing of deliveries for customer with their own delivery vans, ordering calendars with special options including links to customers post code and a Find your nearest stockist.

        Malcolm

        SellerDeck Accredited Partner,
        SellerDeck 2016 Extensions, and
        Custom Packages

        Comment


          #5
          We had exactly the same problem and had to get our host to enable MySQLi on our server.
          Printerbase - Colour & Mono Laser Printers

          Comment


            #6
            That's weird as I am using mysqli on my website already, but only purely in my web server, I have a blog script which connects to the database, so my web server has this feature enabled. Why can't I access it from sellerdeck?

            Comment


              #7
              furthermore, I have ran phpinfo(); on a .php file on my webserver, this has mysqli, mysql, pdo etc enabled



              If I run phpinfo(); within sellerdeck, and preview the page, the settings do not have mysqli mysql pdo etc.



              Any ideas?

              Comment


                #8
                William,
                I think you need to clarify "where" exactly you expect your PHP code to be executed.

                Writing PHP code directly into a SellerDeck layout, within a PHP enabled BlockIf will result in the PHP executing on your local computer i.e. during page preview or page generation *before* being uploaded to the server.
                "Embedding" PHP code into a SellerDeck page is different, as Malcolm alluded to previously. Embedded PHP is put into the page for execution on the hosting server and NOT to be executed locally by SellerDeck.

                It sounds like you are writing PHP which is executing locally, but expecting it to execute on the server as embedded PHP?
                Fergus Weir - teclan ltd
                Ecommerce Digital Marketing

                SellerDeck Responsive Web Design

                SellerDeck Hosting
                SellerDeck Digital Marketing

                Comment


                  #9
                  The PHP within sellerdeck, is not available to use dynamically. Its a specific installation designed purely to allow you to build static pages before upload. It effectively has no server in the real sense. I think you are misunderstanding how php works within sellerdeck.


                  edit: fergus beat me to it x

                  Comment


                    #10
                    Yes, maybe I am misunderstanding it.


                    I am running it 'locally' then I suppose.

                    My understanding is that I can execute php code within sellerdeck offline, this will generate whatever output. When i upload it snapshots these 'outputs' and puts them into html.


                    So I want to be able to get content from a remote mysql database from my sellerdeck software, then upload it with that content.

                    Is what I am trying to do not possible?

                    Comment


                      #11
                      William,
                      Technically you can do what you want, however you'll have a number of challenges, least of all issues of firewalls server side and locally, and not to mention potentially disastrous performance issues in SellerDeck running locally.
                      It would be better for you to go the "embedded php" route and get the PHP running on the server where the mySQL db lives.
                      It really depends on the functionality you are after.

                      E.g. if it is simply to return specific HTML to a page you could use JQuery to call an external PHP file on the server when the web page loads. This PHP/Jquery call would execute server side and return the HTML to the page where you need it.

                      Without knowing the specifics it is hard to give you the best solution. Suffice to say there are several ways to achieve PHP integration - some better than others.
                      Fergus Weir - teclan ltd
                      Ecommerce Digital Marketing

                      SellerDeck Responsive Web Design

                      SellerDeck Hosting
                      SellerDeck Digital Marketing

                      Comment


                        #12
                        Originally posted by fergusw View Post
                        William,
                        Technically you can do what you want, however you'll have a number of challenges, least of all issues of firewalls server side and locally, and not to mention potentially disastrous performance issues in SellerDeck running locally.
                        It would be better for you to go the "embedded php" route and get the PHP running on the server where the mySQL db lives.
                        It really depends on the functionality you are after.

                        E.g. if it is simply to return specific HTML to a page you could use JQuery to call an external PHP file on the server when the web page loads. This PHP/Jquery call would execute server side and return the HTML to the page where you need it.

                        Without knowing the specifics it is hard to give you the best solution. Suffice to say there are several ways to achieve PHP integration - some better than others.
                        The functionality I thought was to locally connect from software to mysql database online. If this is a potential risk of performance in sellerdeck then it's probably a bad idea.

                        Secondly my specifics really are this -

                        I don't want to use .php for my product pages,

                        I am wanting to build a review script within a .php file which customers can go to and enter a review, this review would get inserted into the mysql database on my webserver. This at the moment is the easy part.

                        Then when a product page loads up and that Item Ref exists in the database, it will pull that data into the page.


                        To be honest, I want to do what is best, I just thought the way I was thinking was the only way.


                        If you can advise me on the best way, I would greatly appreciate it.

                        Comment


                          #13
                          From what you describe I'd go with the jQuery/Ajax call to load the review information into the page.

                          You can see a simple example of what I mean here:
                          http://www.w3schools.com/jquery/jquery_ajax_load.asp
                          You'd pass the product reference as a variable to the PHP page's query string and get the PHP page to return the HTML to display the review info.
                          It sounds like you've got the PHP/database part already done.

                          All you'd really need on your web page (assuming jQuery library loaded) is a couple of lines of Javascript.

                          This bypasses any need for any HTML generation and associated issues locally within SellerDeck.

                          Others may have an alternative method, however I know the above works well.
                          Indeed, sellerdeck uses similar technique for the filtering results etc.
                          Fergus Weir - teclan ltd
                          Ecommerce Digital Marketing

                          SellerDeck Responsive Web Design

                          SellerDeck Hosting
                          SellerDeck Digital Marketing

                          Comment


                            #14
                            Originally posted by fergusw View Post
                            From what you describe I'd go with the jQuery/Ajax call to load the review information into the page.

                            You can see a simple example of what I mean here:
                            http://www.w3schools.com/jquery/jquery_ajax_load.asp
                            You'd pass the product reference as a variable to the PHP page's query string and get the PHP page to return the HTML to display the review info.
                            It sounds like you've got the PHP/database part already done.

                            All you'd really need on your web page (assuming jQuery library loaded) is a couple of lines of Javascript.

                            This bypasses any need for any HTML generation and associated issues locally within SellerDeck.

                            Others may have an alternative method, however I know the above works well.
                            Indeed, sellerdeck uses similar technique for the filtering results etc.

                            Thanks a lot for your advice, really appreciate it!. I will definitely use the ajax/jquery method.

                            Comment


                              #15
                              Originally posted by fergusw View Post

                              Others may have an alternative method, however I know the above works well.
                              Indeed, sellerdeck uses similar technique for the filtering results etc.
                              Here is a link http://www.browncoworganics.co.uk/br...Stockists.html to a stockist finder inside a Sellerdeck page, scroll down to botttom of page to see it in action. The page uses jquery and ajax calls to php code running on the server to access a MySql database that returns all stockists within the specified area of the given post code. It is more complex than you need but demonstrates the process and the speed of access.

                              Malcolm

                              SellerDeck Accredited Partner,
                              SellerDeck 2016 Extensions, and
                              Custom Packages

                              Comment

                              Working...
                              X