Jump to content

Recommended Posts

first do you have any code that you are using?

 

you said you just purchased webspace. so your hosting service should give you some kind of admin access to set up a database. i have one with 1and1.com and depending on the package you purchased you should have access to where you are saving your files on the server. the main admin screen allows you to select database and once in there its kinda like using phpMyAdmin if you have used it before. all you do is say create database, then create the tables you need in the database, then create fields in your tables for what you need to save.

 

good way to test this is WAMP. it sets up an Apache server on your local machine so you can test your php, mysql and webpages before you upload to the main site you will be using.

here is the web page to download it.

http://www.wampserver.com/en/

its fairly simple to set up and once you have running. you may need to "install" some of the php classes. by "install" i mean all you have to do is go into the wamp server, click php, then click extension and find the class you need. ie you may need to install certain things such as zip extension.

 

i use the wamp server in conjunction with dreamweaver CS3. if you are using dreamweaver you have to set up a connection to the wamp. on the manage sites link all you have to do is select testing server, set the server mode to php/mysql, access to local/network, testing server folder where you are saving the files usually in C:\wamp\www\(your site here), and set the url prefix to the same as in the same as the server folder not the same "/" just add your site after the / it puts in

Link to comment
https://forums.phpfreaks.com/topic/164772-database-help/#findComment-868899
Share on other sites

Dependent on your host, most hosts do allow the creation and usages of MySQL databases. Your control panel, quite possibly may be cPanel, you have an option if you scroll down the page quite a bit.

 

You will need to identify your database to your HTML form, too.

Link to comment
https://forums.phpfreaks.com/topic/164772-database-help/#findComment-868908
Share on other sites

To create a MySql database. Theirs a link when you login to your cpanel named "MySql". Just follow the instructions and input the fields (database name).

 

When your done, you can use php and add the following code your form. (Input the mysql info within each variable)

 

<?php

//Database Host, Usually localhost
$db_host="localhost";

//Database Username
$db_user="Your database username";

//Database Password
$db_password="Your password";

//Database
$db="Database name";

//Connection to the Database

mysql_connect($db_host,$db_user,$db_password) or die 
("No connection possible");
  mysql_select_db($db) or die
  ("The database does not exist");
?>

 

Make sure to name the file as a .php extension.

 

If you need further help post here, or use google theirs some good tutorials.

Link to comment
https://forums.phpfreaks.com/topic/164772-database-help/#findComment-868917
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.