Jump to content
xisto Community
dhanesh1405241511

Urgent ! Database Help ...

Recommended Posts

Ok guys, this is suddenly out of the blue, but with my limited knowledge in Databases i need URGENT help. My office wants to have a database made of all Schools with the respective information in the State. I need to know what all i need in order to do this. The form will be made in simple HTML no fancy stuff, 1 Page with Form to be filled by the schools with info and Page 2 with a thankyou. thats all.If i need to do this what is the fastest way and the easist way to put all this information into a database. What are my options. MySQL, MS Access, etc ... and how do i work the "adding information" in the database thing.Would really appriciate your help guys, I am on gas now and i sound so desperate i need to be slapped to reality :o ..RegardsDhanesh.

Share this post


Link to post
Share on other sites

If you're planning to use php+mysql database, it is quite easy to store the info into the database, if you don't want anything fancy in 15 minutes you can learn to do it with some simple tutorial, but I mean to learn sql, but if you do not know php yet, it will take longer. Here is a simple resource which might help you fast.

 

http://www.w3schools.com/sql/default.asp

 

But if you want us to help by writing the code, I did not understand then, but hope this help a bit, it is very easy to store and to select the information. But on creating much more bigger databases needs a lot of more work, like playing with JOIN and etc. Also for fast storing and editing of a mysql database use phpmyadmin which is available in the Cpanel :o You can Import and Export the data to any database you prefer, not any, but which the phpmyadmin support. Good luck :P

Share this post


Link to post
Share on other sites

Form : NAME: N2PLACE: AEAGE: 20SEX: FSUBMIT (button)_________________________________Database:NAME | PLACE | AGE | SEX |N1 | US | 19 | M |N2 | AE | 20 | F | ETC ... __________________________________I asked around a bit .. and i got the basic idea, I need MySQL .. PHP ... and HTML to work with this ... could anyone please make me a script that does the above ? i dont know PHP or SQL but what i illustrated above is what i basically needed.I am at college right now, so in 4 hrs i'll be back home. SO if any one would be kind enough to create a example form and script and show me how to install .. i'd be greatful .. Thankx in advanceRegardsDhanesh.email : dhanesh.rs AT gmail.com

Share this post


Link to post
Share on other sites

You'd be better to learn to write it yourself, else you'll always be asking people how to change/improve it etc. http://www.w3schools.com/ is another good place to go. I'll try to give you a better background on the way it works:Create HTML page with form and button.Create PHP page which takes the form values, adds them to the database (using an INSERT INTO query) and shows the thankyou message.You need to set up a database with a table with fields like Name, Age etc. (use phpmyadmin/cpanel/etc. for this). You can actually make it give you the code for inserting it, just perform the action you want to do (insert a new row) and find the "Create PHP code" link. Then you swap out the info for the global variables like $_POST['name'] or whatever.Think that's how it works. Good luck :o

Share this post


Link to post
Share on other sites

Before you can use a database first you need a database to work with so this post will help you create a database and then make at least one table for it to store your information in. Go to the cPanel and in the second table of options labeled Site Management Tools click the MySQL Databases icon.

Posted Image

In the screen that comes up next you will create your new database and take note of any prefix in the illustration below you will notice that it is my username with an underscore _ and yours should be your username_

Posted ImageNow just type in any name that you want and that will create your new database for you. Then you will need a table and using the example that you gave I would add one field to the table the SQL for creating a table is CREATE TABLE tablename {table definitions) So to create a table (lets call it users) the SQL that you could enter using phpMyAdmin (in the cPanel) would look like

CREATE TABLE users (id INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(40),place VARCHAR(50),age INT(3),sex ENUM('m','f'))
That will create a table in whatever your new database is (provided you are in that database) and it will create an autoincrementing id (That is unique) with a name field with 40 characters allowed in the name field, then a Place field with 50 characters allowed in the place field and an age field with an age up to 999 years old and then an enumerated list with two values allowed only which are m or f

Share this post


Link to post
Share on other sites

This is all assuming you actually have webhosting... do you?

If you look at the users group you will notice that they are in the Hosted group, so yes they are hosted and have the cPanel, otherwise I would'nt have gone through the trouble of illustrating it for someone who can't use the information.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.