Current location: Hot Scripts Forums » Programming Languages » PHP » need help creating tables in mysql (VERY SIMPLE QUESTION)


need help creating tables in mysql (VERY SIMPLE QUESTION)

Reply
  #1 (permalink)  
Old 03-25-04, 07:15 PM
meaculpa1113 meaculpa1113 is offline
New Member
 
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy need help creating tables in mysql (VERY SIMPLE QUESTION)

Hi.. i m a newbie, just finishing up creating my webpage.. now i was gonna add a guestbook to it, cuz i dont like the free ones that they have online w/all those annoying advertisements.. so i found a few free online scripts for guestbooks.. i was going through one of them, and everything was pretty self explanatory until one part. i will copy and paste wat the instructions said..

"Part B - Installation and testing
1. First and foremost is the fact that you need a database and table. I cannot go into how to set-up a database here. Either you know how or you don't.
a. If you're on a host with PHPMyAdmin, life will be a lot easier for you.
b. Once you've created your database, you need to change the values of the variables at the top of "addrecord.php" and "guestbook.php" so that your username, password, and database name are correct. Once you see the files, you'll notice that they're pretty self explanatory."

I have no idea how to create a database.. I am putting up the file on my school server, and know that server supports everything that is required. These are the lines that i need to fill in the code for. If anyone could help out it would be much appreciated.

$user = "USERNAME";
$password = "PASSWORD";
$db = "DATABASE_NAME";

my site address is, www.ic.sunysb.edu/stu/ssanghav

would my username and password be the username n password i use to log into my webserver?

so basically i have access to a unix shell script where i upload all my files for the webpage, but just need to know how to create the guestbook.

Anybody who can help?

It is much appreciated. Thank you
Reply With Quote
  #2 (permalink)  
Old 03-25-04, 11:04 PM
dotbob dotbob is offline
Newbie Coder
 
Join Date: Oct 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
You can do it via the shell comand line but it would be much easier through a GUI interface. Do you have some sort of control panel installed? Have you been assigned a database?

$user = "USERNAME"; //usually is same as server UserName but sometimes not
$password = "PASSWORD"; //Same as above
$db = "DATABASE_NAME"; //This one is a bit trickier

"DATABASE_NAME" could either be refering to the database server/host or table. I'll guess that the developer has hard-coded the server name into the script as 'localhost' and that you will need to create a database table and assign this name to $db.

You need to find out 1)what type of database you were assigned(MySQL?) 2)are the uasername and pass the same as for server 3)any GUI interface to the database.


James
__________________
<img src="http://ebigman.com/image/dotbob_small.gif">Premium Domain Nameshttp://www.dotbob.ebigman.com
Reply With Quote
  #3 (permalink)  
Old 03-26-04, 12:32 AM
dark one dark one is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Cool

here is what you need to do:
1. get your system administrator and find out if MySQL is installed, you have access to it and what your username and password for it and what's the hostname. Also you need to have permission to create a database or have one already.
2. if things fine go to the shell and run the following commands to create a database:
> mysql -u[username] -p -h[hostaname]
thand type your password
> create database [databasename];
3. Get to the script and set your username, password and database name you've created to appropriate positions.
4. things should work. if they won't find in your script line with function
mysql_connect ( [string server [, string username [, string password [, bool new_link [, int client_flags]]]]]);
and find out if server value matches mysql hostname admin gave you. if not get it so.
5. if still things would not work - go kick you admin to make php & mysql work with each other.
Reply With Quote
Reply

Bookmarks

« user | Help please. »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
question about updating a page or database for an, php and mysql updating mikewooten PHP 1 02-12-04 12:11 AM
error when creating database tables with php script spiroth10 PHP 4 01-06-04 03:59 PM
PHP to MySQL script question...(using a field to update info in MySQL) DisneyFan25863 PHP 4 11-02-03 03:31 AM
MySQL with PHP question. HELP for a newbie kenfused PHP 3 08-02-03 12:53 AM


All times are GMT -5. The time now is 10:21 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.