icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » creating a database

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old September 17th, 2004, 8:31 PM   #1 (permalink)
Registered User
Fresh Surpasser
 
Joined in Aug 2004
25 posts
Gave thanks: 0
Thanked 0 times
creating a database

I am trying to create a new database. I wrote a php script to create the database and a table, but when I run it I get an error that says

"Fatal error: Call to undefined function: mysql_create_db() in /home/kindasi/public_html/classes/db.php on line 66"


So then I go into myPHPAdmin, and try to create the database using the web interface, and I get this error:

"Error

SQL-query :

CREATE DATABASE `test` ;

MySQL said:

#1044 - Access denied for user: 'kindasi[at]localhost' to database 'test' "


Even if I try to log out of MyPhpAdmin I get an error:

"Wrong username/password. Access denied."

Any ideas how I can fix this problem?
whitee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 17th, 2004, 8:33 PM   #2 (permalink)
SurPerson
On a golden path...
 
TJ09's Avatar
 
Joined in Jul 2004
Lives in front of my laptop
Hosted on Sync
437 posts
Gave thanks: 0
Thanked 1 Time in 1 Post
That's because you have to create DB's through the CPanel mySQL section, not phpMyAdmin
__________________
Me: TeeJay
Server: Sync (Statistics)
Site: technoized.com (Statistics)

chown -R us ./base
TJ09 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 1:14 AM   #3 (permalink)
sam
Surpass Fan
Super #1
 
sam's Avatar
 
Joined in Dec 2003
Lives in NJ
5,057 posts
Gave thanks: 0
Thanked 4 times
That is correct TJ09. Nice work.
sam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 1:52 AM   #4 (permalink)
Registered User
Fresh Surpasser
 
Joined in Aug 2004
25 posts
Gave thanks: 0
Thanked 0 times
Thats it

Ah....thanks for the help
whitee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 2:53 AM   #5 (permalink)
Registered User
Fresh Surpasser
 
Joined in Aug 2004
25 posts
Gave thanks: 0
Thanked 0 times
file size too big

I am trying to upload a file, but the upload of large files isnt working. I have increased the MAX_FILE_SIZE, without success. Does this mean that the setting within the php.ini file is too small? If so, how do I edit it?

The form

<form name="addpic" enctype="multipart/form-data" action="upload.php?action=submit" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="90000000000" />
<h1>Add Daily Photo</h1>
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td>File:</td>
<td><input name="userfile" type="file" /> </td>

The Report
name => IMG_2522.JPG
type =>
tmp_name =>
error => 2
size => 0
upload failed. error code: 2
whitee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 2:55 AM   #6 (permalink)
Web Hosting Super Ninj4
Super #1
 
miakeru's Avatar
 
Joined in Sep 2003
Lives in Fullerton, CA
1,581 posts
Gave thanks: 0
Thanked 2 times
The server has a set limit allow a maximum of two megabytes to be uploaded through HTTP, I believe. You would not be able to change this yourself, but may be able to ask an admin to do so.

How big was that image?
miakeru is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 3:01 AM   #7 (permalink)
Registered User
Fresh Surpasser
 
Joined in Aug 2004
25 posts
Gave thanks: 0
Thanked 0 times
Image size

The image size is a little over 600 KB
whitee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 1:43 PM   #8 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,688 posts
Gave thanks: 6
Thanked 7 times
Uploads are tricky... The process needs to go as such:

1) User completes form.

2) Script chmods destination folder to 0777.

3) Script copies desired file_name to directory.

4) Script chmods destination folder to 0755.

5) Display result.

2a) In order for the chmod() to complete successfully, the destination folder must be created by PHP ahead of time. See below.

2a-1) Create file "dir.php"

2a-2) Insert following coding into file.
Code:
<?php mkdir("/home/[USERNAME]/public_html/[DESTINATION_NAME]/" 0755); ?>
2a-3) Save dir.php

2a-4) Run dir.php

This should have created the folder for you, with a chmod of 0755. Then the upload script should be able to run as expected.

If you encounter problems, PM me (if it's working), e-mail me admin[at]kickersny[dot]com or hit me up on AIM -- kickersnydotcom. I'd be glad to help.
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 18th, 2004, 9:02 PM   #9 (permalink)
Registered User
Fresh Surpasser
 
Joined in Aug 2004
25 posts
Gave thanks: 0
Thanked 0 times
permissions

Thanks kickersny.com. I reworked the code following you guidelines and it worked. I think the script changing the file permissions may have been the thing, but I know that I set them to 777 with my ftp program. No matter. it works. thank you.
whitee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

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