New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

database creation


Post Reply New Thread Subscribe

 
Thread Tools
gotenks05

 
gotenks05's Avatar
 
Member Since: Oct 22, 2006
Posts: 64
gotenks05 is on a distinguished road

gotenks05 is offline
I am new to using MySQL, since I just got it to work with the help of somebody from a different Mac-focused forum today. I want to create a guestbook and require visitors of my site to log in to be able to upload things to my website. The trouble that I am encountering is that I typed up the php code to make and delete databases and one to make a table, but when I tell it to connect through the root user, for testing on my Mac, and open the file in Safari there is nothing, that my book tell me to expect (through illustrations), because the page is blank. I have installed the GUI tools from the MySQL site, which has made things a bit more simple, but I still cannot figure how to give the users permission to do this stuff, because I created another user and still no results of what I expected to see, just a black page instead of fields to fill in. I tried to download PHPMyadmin that I read about on another thread, but the installation instructions were not that clear, mainly because the only tar package was what the stuff came in. Is there anything else that I can use to easy control over MySQL besides the GUI tools and PHPMyadmin (preferably something that does not require compiling)?
QUOTE Thanks
Del

 
Member Since: Dec 24, 2006
Location: N. Ireland
Posts: 901
Del has a spectacular aura about
Mac Specs: Mac Pro 2xQuad core 2.8GHZ

Del is offline
If you posted up your php code it would give us a bit more to go on.
QUOTE Thanks
cazabam

 
cazabam's Avatar
 
Member Since: Jun 06, 2006
Posts: 1,153
cazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of light
Mac Specs: MacBook 2.0GHz White, 512MB RAM, 60GB HDD

cazabam is offline
Why are you writing PHP code for stuff like database creation and table creation? You should probably just use the MySQL command line for that if you're getting started because then you can follow the tutorials and documentation on the Developer section of mysql.com.
QUOTE Thanks
gotenks05

 
gotenks05's Avatar
 
Member Since: Oct 22, 2006
Posts: 64
gotenks05 is on a distinguished road

gotenks05 is offline
Quote:
Originally Posted by cazabam View Post
Why are you writing PHP code for stuff like database creation and table creation? You should probably just use the MySQL command line for that if you're getting started because then you can follow the tutorials and documentation on the Developer section of mysql.com.
I did it in PHP, because I cannot access the command line, and the information listed in the terminal, after getting MySQL to run was not that clear to me. Sure I the GUI tools from the MySQL site, but the program in that package to do this stuff was an alpha version, with no help files. Next, I am learning this stuff from a book (it is written as if I am using windows/Linux, but the codes it tells me to type in work on Mac). I will post a zip file of those php files on my next post ( I still have the database creation script, but I need to recreate the others because I deleted them (out of frustration)).
QUOTE Thanks
gotenks05

 
gotenks05's Avatar
 
Member Since: Oct 22, 2006
Posts: 64
gotenks05 is on a distinguished road

gotenks05 is offline
Alright here is the zip file containing the three php scripts.
Attached Files
File Type: zip database_scripts.zip (2.0 KB, 1 views)
QUOTE Thanks
cazabam

 
cazabam's Avatar
 
Member Since: Jun 06, 2006
Posts: 1,153
cazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of light
Mac Specs: MacBook 2.0GHz White, 512MB RAM, 60GB HDD

cazabam is offline
There could be any number of problems ranging from PHP not having the MySQL libraries installed to the user not having permission. Unfortunately without more information I'd just be clutching at straws.

Where are you hosting this if you can't get access to the command line? If it's a shared hosting account or similar that provides MySQL support they should be able to create the database for you. It's generally considered bad form to do thinks like creating databases and users in dynamic scripts. Creating the tables as a one-off installation is OK though.
QUOTE Thanks
cazabam

 
cazabam's Avatar
 
Member Since: Jun 06, 2006
Posts: 1,153
cazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of light
Mac Specs: MacBook 2.0GHz White, 512MB RAM, 60GB HDD

cazabam is offline
There could be any number of problems ranging from PHP not having the MySQL libraries installed to the user not having permission. Unfortunately without more information I'd just be clutching at straws.

Where are you hosting this if you can't get access to the command line? If it's a shared hosting account or similar that provides MySQL support they should be able to create the database for you. It's generally considered bad form to do thinks like creating databases and users in dynamic scripts. Creating the tables as a one-off installation is OK though.

edit: one other thing; when you put an @ before a function call it suppresses error messages. Take those away from the front of the mysql_* functions to get the actual error echoed to the screen.
QUOTE Thanks
cazabam

 
cazabam's Avatar
 
Member Since: Jun 06, 2006
Posts: 1,153
cazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of light
Mac Specs: MacBook 2.0GHz White, 512MB RAM, 60GB HDD

cazabam is offline
Oops, looks like a glitch with the inline editor. Can a mod delete the first of my two duplicate posts?

Ta
QUOTE Thanks
gotenks05

 
gotenks05's Avatar
 
Member Since: Oct 22, 2006
Posts: 64
gotenks05 is on a distinguished road

gotenks05 is offline
Right now my site is hosted at http://www.kwikphp.com, because the host I originally had, which was at http://www.9999mb.com, deleted my account. There is no web-based control panel, so I cannot sign in and create databases. Also, my book said that MySQL features in PHP, were used with MySQL 4, but my current host gave me a url that began with sql3. For my testing purposes, I have tried to host it on my own computer (after getting the MySQL to work on Mac), and then upload it if it works correctly, except changing the MySQL connection info to what they gave me, instead of having in connect through the root user.
QUOTE Thanks

Post Reply New Thread Subscribe


« style="page-break-before:always not working | how do i find out other websites traffic per day? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Database software for Mac & Windows Mobile mokjok Switcher Hangout 2 01-22-2007 07:11 PM
Any database programs cheaper then FileMaker? PapaNoHair Switcher Hangout 6 09-24-2006 11:40 PM
HUGE Outlook Express database problem! sparky Running Windows (or anything else) on your Mac 0 12-10-2005 02:48 AM
using dreamweaver to point to Database design2 Web Design and Hosting 0 08-24-2004 05:23 PM
Database Name and Username sKaD Web Design and Hosting 4 11-14-2003 01:53 AM

All times are GMT -4. The time now is 01:51 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?