| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#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? |
|
|
|
|
|
#2 (permalink) |
|
SurPerson
On a golden path...
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 |
|
|
|
|
|
#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 |
|
|
|
|
|
#6 (permalink) |
|
Web Hosting Super Ninj4
Super #1
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? |
|
|
|
|
|
#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-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 |
|
|
|
|
|
#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.
|
|
|
|