Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. Writng a non-database specific code in PHP

Writng a non-database specific code in PHP

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
csharpphpdatabase
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    awedaonline
    wrote on last edited by
    #1

    Hello guys; I am from .NET background where I write data access code to any database platform using the DbFactory and the like. I need a sample code that can connect to any database that all i need to supply is the database provider name, database name, user name, password, etc. Thank you for your understanding and support.

    P S 2 Replies Last reply
    0
    • A awedaonline

      Hello guys; I am from .NET background where I write data access code to any database platform using the DbFactory and the like. I need a sample code that can connect to any database that all i need to supply is the database provider name, database name, user name, password, etc. Thank you for your understanding and support.

      P Offline
      P Offline
      Peter_in_2780
      wrote on last edited by
      #2

      PHP Manual >> Function Reference >> >> Database Extensions >> >> >> Abstraction Layers Peter

      Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

      A 1 Reply Last reply
      0
      • A awedaonline

        Hello guys; I am from .NET background where I write data access code to any database platform using the DbFactory and the like. I need a sample code that can connect to any database that all i need to supply is the database provider name, database name, user name, password, etc. Thank you for your understanding and support.

        S Offline
        S Offline
        sali22
        wrote on last edited by
        #3

        hi , if you want to connect to the Mysql database you can use the below code to connect and select your database

        ";
        mysql_select_db("test") or die(mysql_error());
        echo "Connected to Database";
        ?>

        A 1 Reply Last reply
        0
        • P Peter_in_2780

          PHP Manual >> Function Reference >> >> Database Extensions >> >> >> Abstraction Layers Peter

          Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

          A Offline
          A Offline
          awedaonline
          wrote on last edited by
          #4

          Thank u Peter.

          1 Reply Last reply
          0
          • S sali22

            hi , if you want to connect to the Mysql database you can use the below code to connect and select your database

            ";
            mysql_select_db("test") or die(mysql_error());
            echo "Connected to Database";
            ?>

            A Offline
            A Offline
            awedaonline
            wrote on last edited by
            #5

            I truly appreciate your response.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups