The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using Created Database

Discussion in 'Database Discussions' started by Spunky, Jun 3, 2009.

  1. Spunky

    Spunky Registered

    Joined:
    Jun 3, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Ok. So I know how to make a database using PHP MyAdmin thing, but, I haven't a clue how to use it on my site. I've been searching around and just can't figure it out. I've tested a php page on my host to see if it works using simple script and it works fine, but, I don't know how to use MySQL. I know you put php script in a .php file but what about MySQL? Do I need to even make a file or does it happen directly from PHP MyAdmin? I use Dreamweaver if that helps at all. I've gone on w3schools.com for all my PHP and MySQL scripting needs, but, I don't know either language, planning to learn what I need as I go along.

    The only thing I've gathered that seems to be relevant is:

    $con = mysql_connect("localhost","username","password");

    But what then? In the PHP MyAdmin thing there is a small amount of code that it shows when I am viewing a table that I can click a button to change it to PHP code and Ive also pasted that into my file, but I only get a blank white page when I upload it.

    Basically I am almost clueless. I need a little boost in the right direction.:confused:
     
  2. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    What are you trying to do?

    MySQL is a database program. It is used to store information within a DB. You will have to put information in the DB to retrieve it with the PHP, or of course have the PHP create/add data.

    It sounds like you are just trying to make a page, you don't need to make it use MySQL. If you are trying to make a page with MySQL you probably want to try another forum - you have figured out the cPanel side of things now you have to get the programming bit down.
     
  3. Spunky

    Spunky Registered

    Joined:
    Jun 3, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Yea I guess I'm not exactly sure which forums to be in. I'm not exactly trying to make a page with MySQL, nor PHP, I mean, maybe I am. Basically I want people to be able to search my on my site, like not nessessarily a search bar, but that would be nice too, but when they click on a link it takes data from a database and puts it on a page it links to. I did put information into the databases I created, made tables, set primary keys. Now I just need to know where to go from here. How to implement these databases on my site. Maybe I am in the wrong forums, in which case it'd be nice to be directed to a correct one, or the type of one to be looking for.
     
  4. PlatinumServerM

    PlatinumServerM Well-Known Member
    PartnerNOC

    Joined:
    Jul 10, 2005
    Messages:
    397
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    New Jersey, USA
    cPanel Access Level:
    Root Administrator
  5. Spunky

    Spunky Registered

    Joined:
    Jun 3, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I don't want premades that won't help because I still won't know what to do with them. My problem is is I dont know where to put the code, what kind of file, to do what. I don't know how to access the database that I created nor the content that I filled it with. Once I know where to put the script I create/find to access the database and the content in it, then I will find the script or find the knowledge to create the script. But I need to know where to script it.

    Problem with all these tutorials and pre-mades is that it doesnt tell me where to put it. Nor do I know how to access the database I created, how to incorporate it on my site.
     
Loading...

Share This Page