database creation

Joined
Oct 22, 2006
Messages
64
Reaction score
2
Points
8
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)?
 

Del


Joined
Dec 24, 2006
Messages
901
Reaction score
15
Points
18
Location
N. Ireland
Your Mac's Specs
Mac Pro 2xQuad core 2.8GHZ
If you posted up your php code it would give us a bit more to go on.
 
Joined
Jun 6, 2006
Messages
1,153
Reaction score
94
Points
48
Your Mac's Specs
MacBook 2.0GHz White, 512MB RAM, 60GB HDD
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.
 
OP
gotenks05
Joined
Oct 22, 2006
Messages
64
Reaction score
2
Points
8
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)).
 
Joined
Jun 6, 2006
Messages
1,153
Reaction score
94
Points
48
Your Mac's Specs
MacBook 2.0GHz White, 512MB RAM, 60GB HDD
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.
 
Joined
Jun 6, 2006
Messages
1,153
Reaction score
94
Points
48
Your Mac's Specs
MacBook 2.0GHz White, 512MB RAM, 60GB HDD
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.
 
Joined
Jun 6, 2006
Messages
1,153
Reaction score
94
Points
48
Your Mac's Specs
MacBook 2.0GHz White, 512MB RAM, 60GB HDD
Oops, looks like a glitch with the inline editor. Can a mod delete the first of my two duplicate posts?

Ta
 
OP
gotenks05
Joined
Oct 22, 2006
Messages
64
Reaction score
2
Points
8
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.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top