Announcement

Collapse
No announcement yet.

Connecting php/MySQL to HTML... HELP PLEASE?

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

  • Connecting php/MySQL to HTML... HELP PLEASE?

    Alright, here's my problem...
    I have a website that is setup using php/mysql to update things like product listings, authorized dealers, and news/press releases. Everything works.

    I need to set up a similar site, which will have all the capabilities of the first but with different data. It's a new division of our company, and the demographic is different. We don't want the 2 sites sharing content.

    What I've done so far:
    I have the 2nd site setup, coded, etc. Everything works except the database. I copied everything over and was able to connect to the FIRST database.

    I created a new database, backed up the 1st, and restored it to the new db. I did this for simplicity, so I don't need to recreate everything.

    I cleared most of the content from the 2nd db, leaving only what I need for the 2nd site.

    How do I connect to the 2nd db, from the 2nd site?

    I can post links or code, if needed. Here's a snippet from the 1st site.

    Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="../../Connections/ksport.asp" -->
    <%
    Dim rsMotorsports__varID
    rsMotorsports__varID = "null"
    If (request.queryString("press_id") <> "") Then 
      rsMotorsports__varID = request.queryString("press_id")
    End If
    %>
    And the same section of code from the 2nd site, with minor modifications that I made in attempt to get this working.

    Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="../../Connections/moben.asp" -->
    <%
    Dim rsMotorsports__varID
    rsMotorsports__varID = "null"
    If (request.queryString("press_id") <> "") Then 
      rsMotorsports__varID = request.queryString("press_id")
    End If
    %>
    I did create a new file in the "connections" folder. here's it's code.

    Code:
    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO" 
    ' DesigntimeType="ADO"
    ' HTTP="true"
    ' Catalog=""
    ' Schema=""
    Dim MM_moben_9376_STRING
    MM_moben_9376_STRING = "dsn=ksport;uid=moben_9376;pwd=****;"
    %>
    and here is the old connections file:

    Code:
    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO" 
    ' DesigntimeType="ADO"
    ' HTTP="true"
    ' Catalog=""
    ' Schema=""
    Dim MM_ksport_STRING
    MM_ksport_STRING = "dsn=ksport;uid=*******;pwd=*******;"
    %>

    Sorry for the huge post. Just wanna give you guys all the info I can up front.

  • #2
    you just need to change the database name in the connection file to the name of your second database, and make sure the user name/password match your second database as well...

    in the new connections file above, perhaps dsn=ksport should be 'moben'?
    Monarchs Rule!

    Comment


    • #3
      I believe I've tried that.

      I forgot to mention that the 2nd database is hosted on a different server than the first. Also, the website is on it's own server. Cheap webhosts ftl...

      Comment


      • #4
        then check with the webhosts if they allow remote *sql connections the "cheap" hosts normally deny those requests and that may be the whole problem.

        Comment


        • #5
          I'll look into that. I'm sure they do, though, considering the 1st site works.
          Thanks for that suggestion, though.

          Oh, the joys of taking over someones job...

          Comment


          • #6
            Originally posted by Drazan View Post
            then check with the webhosts if they allow remote *sql connections the "cheap" hosts normally deny those requests
            Originally posted by Pendulum View Post
            I'll look into that. I'm sure they do, though, considering the 1st site works.
            I'm not sure you understood what Drazan was telling you. You said: "the 2nd database is hosted on a different server than the first. Also, the website is on it's own server".

            Site #1 works because it's making calls to a local database. If Site #2 is hosted on a different server but it's trying to connect to a database on Site #1, then Site #1 needs to allow remote connections to it's database from the server that Site #2 resides on. If it doesn't, then the connection is going to be refused by Site #1.

            Digi
            Last edited by digizan; 10-21-2009, 08:18 PM.
            The world is divided into people who think they are right.
            —Anonymous

            Comment


            • #7
              I guess I should have been more clear...
              Everything is hosted by the same company.

              Both websites are on one server.
              Each database is on it's own server, for a total of 3 servers.

              Comment


              • #8
                Originally posted by Pendulum View Post
                I guess I should have been more clear...
                Everything is hosted by the same company.

                Both websites are on one server.
                Each database is on it's own server, for a total of 3 servers.
                So then your setup is:

                Server #1 @ cheaphost.com
                server1.site1.com
                server1.site2.com

                Server #2 @ cheaphost.com
                server2.database1

                Server #3 @ cheaphost.com
                server3.database2

                DB Connections
                server1.site1.com -> server2.database1 (works)
                server1.site2.com -> server3.database2 (doesn't work)

                If the above is correct AND you're 100% certain that all of your db names, usernames, passwords, and any paths to connections settings files are correct AND you know for a fact that remote connections are allowed from server1.site2.com -> server3.database2, then it doesn't make sense for things not to be working.

                I would suggest that you contact cheaphost.com and notify them of what you've tried as well as any db error messages you're receiving. If everything is hosted by them, then they should be able to help you track down the problem—maybe something on server3.database2 is misconfigured or whatever. For us to continue to attempt to guess at the problem from afar is at best an exercise in futility.

                Digi
                The world is divided into people who think they are right.
                —Anonymous

                Comment


                • #9
                  Alright, I'll give that a shot.

                  Thanks for all the help, guys.

                  Comment

                  Search

                  Collapse

                  Advertisement

                  Collapse

                  Latest Topics

                  Collapse

                  • PrintDriver
                    Reply to Changing Color Mode
                    PrintDriver
                    Changing the color mode using File >Document color mode is what I was talking about
                    It does mess with color values and certainly messes with Black. If you go from an RGB file with the Black swatch...
                    Today, 11:40 PM
                  • Pavlo
                    Comment on Logo Critique. Only hobby
                    Pavlo
                    I think what's off balance with the Royal Bank logo is the kerning. It's all over the place, especially between the 'Y' and the 'A'.

                    To the OP: Looking closer at your other logos, kerning...
                    Today, 10:48 PM
                  • AJP
                    Reply to Sorry to add another "Logo Review" thread to the forum...but...
                    AJP
                    PD, thanks for the link. Will read up on SM vs TM.

                    Regarding the logos -- no, I'm not opposed to the first, offsetting the "P." Curiously, I don't think it's so bad when I mock...
                    Today, 10:41 PM
                  • PrintDriver
                    Reply to Purchase font
                    PrintDriver
                    Here's the thing with some clients. They find fonts. Sometimes in weird and sometimes not so savory places.

                    The only reference I can find of an LT 65 medium bold is on a free font download...
                    Today, 10:11 PM
                  • PrintDriver
                    Reply to Trouble to find resources
                    PrintDriver
                    There are literally hundreds of high quality stock photo sites out there.
                    As well as font sites.
                    There are also lots of sites related to car wrap art that have ''cool stuff.''
                    Here's...
                    Today, 10:01 PM

                  Incredible Stock
                  GDF A division of Mediabistro Holdings Adweek | Mediabistro | Clio | Film Expo Group Contact Us | Terms of Use | Privacy Policy Copyright © 2016 Mediabistro Holdings
                  Working...
                  X