No Database Selected (First time attempting a Blog)
I am attemtping, for the very first time to install a simple script that allows a one person blog.
I've uploaded everything to my server and when I try to access the blog page I get the folowing message - No Database Selected.
I have no idea as to what that might mean, or what I should input into the required areas. (yeah I'm pretty green when it comes to this). I've included some of the code (see below) to let you know what I am confused about. Specifically I'm wondering about the database code that I am supposed to supply. My question is, can I get an example of what might possibly be entered into this area so that I can search for that on my own? At first I put phpBB (4.3.11) just because I had no idea what it wanted. Of course it never worked. I knew it wouldn't...
Any guidance would be appreciated. Thanks
/* declare variables */
$db_type = 'mysql';
$wfhostname = "localhost"; <---- what do I put here?
// Edit these:
$wfdatabase = "not sure what to put here"; <---- what do I put here?
$wfusername = "username";
$wfpassword = "password";
ddf1230 posted this at 22:06 — 23rd January 2006.
They have: 17 posts
Joined: Jan 2006
You'll need to first create a database. Most people do so via their CPanel, but it depends upon your hosting setup. When you create the database (which is easy to do and is wizard-like), you will give it a name. That name goes in the $wfdatabase section. Then you create a user that has access to the database (again through your CPanel or equivalent). You give that user a username and password. That username and password would be supplied in the $wfusername and $wfpassword section. Finally, most of the time, you don't need to change the $wfhostname = "localhost"; part. It usually is localhost. But if that doesn't work, you'll need to ask your hosting company what to put there.
Win a free copy of Windows Vista
NewTechGuy posted this at 22:43 — 23rd January 2006.
He has: 57 posts
Joined: Dec 2004
Thanks for your help. I've now ceated a database and have created a user and a password. Uploaded the files and am now getting the following message.
---------------------------------------------------------------
Warning: mysql_pconnect(): Access denied for user: 'global1@localhost' (Using password: NO) in /home/global1/public_html/wfblog/settings.php on line 48
Fatal error: Access denied for user: 'global1@localhost' (Using password: NO) in /home/global1/public_html/wfblog/settings.php on line 48
---------------------------------------------------------------
I've supplied the database name, username and password in the required lines.
So now I'm wondering what do I need to change now? I've included line 48 below. Or maybe I should be asking .......what information is it requiring that I input?
------------line 48--------------
/* create a persistant connection */
$wflink = mysql_pconnect($wfhostname, $wfusername, $wfpassword) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($wfdatabase, $wflink);
--------------------------------
Thanks again for any assistance.
ddf1230 posted this at 23:18 — 23rd January 2006.
They have: 17 posts
Joined: Jan 2006
Check with your host to see if the hostname should be changed from localhost to something else.
NewTechGuy posted this at 16:42 — 24th January 2006.
He has: 57 posts
Joined: Dec 2004
I checked with my hosting provider and the hostname is correct (localhost). I've made progress but am stuck once again. I cannot create the needed table for this project. It won't let me put anything in the FIELD section (box). There must be something that HAS (or can) go into it. Can anyone let me know what I'm supposed to put into this box?
This is the error messsage I get from the server:
CREATE TABLE `wfblog` (
`wfblog` VARCHAR( 255 ) NOT NULL AUTO_INCREMENT ,
PRIMARY KEY ( `10` )
) TYPE = MYISAM
MySQL said:
#1063 - Incorrect column specifier for column '[B]wfblog' [/B]
And the following is the code I have to work with. It was supplied by the developer of the script. (Maybe someone can see something that I'm missing.)
Here is the SQL syntax for creating the needed table...
CREATE TABLE wfblog (
blog_id int(11) NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
content text NOT NULL,
published timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
display char(1) default NULL,
PRIMARY KEY (blog_id)
)
Thanks for any further assistance.
ddf1230 posted this at 18:56 — 24th January 2006.
They have: 17 posts
Joined: Jan 2006
I'm a little lost on what you attempted to do, but if you use phpmyadmin, you should be able to enter the sql code exactly as provided by the script developer and it should work. Perhaps if you tell us how you were attempting to go about creating the table, it would help.
Win a free copy of Windows Vista
NewTechGuy posted this at 20:36 — 24th January 2006.
He has: 57 posts
Joined: Dec 2004
Yeah, I knew this stuff was a little "over-my-head" but I thought I'd give it a try. Up to this point I've been able to use phpmyadmin to create a new database however I have been unable to create a table.
I will explain how I attempted to create a table:
After clicking on phpmyadmin I got a new window. From here, I am required to choose a database from a drop-down list in order to continue, and so I did. I chose _blog which is the name of the database I originally created. From there I was transferred to another page.
From this new page I am asked to "Create new table on database global1_blog:" which I have done, and I gave the table the name wfblog (I got that table name from the php script). I am also asked to provide a number for the "Number of fields:" and input that number into a box. Since I have NO IDEA what this means I just enter the number 1 ... then I click on "Go".
I arrive at yet another page, and apparently this is where all my troubles begin.
On this page I have to input a bit of information. When doing so, I've used the information from the script (supplied by the developer and which I included in BOLD, in one of my previous posts above). I'm asked to supply the following information.
Field Type Length/Values* Attributes Null Default** Extra
I am only having a problem with one of these... the "Field"..... I can not input anything at all into the Field area without getting a message like the following:
#1063 - Incorrect column specifier for column 'wfblog'
Now, it doesn't matter what I put into the Field area. Nothing works. If there is something inside the script that is supplied for me by the developer that MUST be put into this area then I am not seeing it, or understanding it. All I know is nothing is acceptable for the Field area! I get the same error message all the time (except for the "wfblog" part at the end of the error message, that will change to whatever I tried to input into the field area) and therefore I am unable to continue on and create the required table . I've tried numbers, different names, and even greek stuff etc... but the Field area won't take any of it.
Oh and one last thing, if I attempt to view the blog using a browser, the browser returns the following error..... Table 'global1_blog.wfblog' doesn't exist. I'm not surprised since there is no table created, I just thought it may help you.
That's about all I've got for now. If it's too much then I'm gonna have to call it a day and quit <----I hate that word.
Once again, thanks for your interest.
ddf1230 posted this at 20:55 — 24th January 2006.
They have: 17 posts
Joined: Jan 2006
Ok, well, I would have gone about it differently, so maybe if you try it the way I would have done it, it will work. First, I'd delete the table you created. Then, i'd start over. Once you select the database from phpmyadmin, look right above the database name, and you should see a little icon that says SQL. Click on that and replace whatever default sql statement that they have there (mine says SELECT * FROM `word` WHERE 1), with the entire sql statement that the developer gave you. Then click on Go. That should set up the table for you with no further work on your part. Hope that helps.
Win a free copy of Windows Vista
NewTechGuy posted this at 22:01 — 24th January 2006.
He has: 57 posts
Joined: Dec 2004
Okay, it's official......I GIVE UP. There is just to much that I don't know, or understand about this.
I did exactly what you said and everything was good until I had to replace the default sql statements with the entire sql statement that the developer supplied. I never had anything like you had that says (SELECT * FROM `word` WHERE 1)... I just have a big empty text box.
On top of that I have no idea what the sql statement would be. To me it could be either this...
blog_id int(11) NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
content text NOT NULL,
published timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
display char(1) default NULL,
PRIMARY KEY (blog_id)
OR THIS........
I tried both options because I have no idea what I'm doing. The truth is I just don't have the experience to know.
I also don't know if "query" means the same as statement <--- yeppers, just don't know.
You make it sound so easy until I get to where I'm supposed to be and discover things don't look the same or that I just don't understand the terminology.
So....I'm gonna stop. It's too frustrating. But I would like to extend a BIG thank you to you for trying. I appreciate everything you've tried. Thank you so much.
with the entire sql statement that the
developer gave you. Then click on Go. That should set up the table for you
with no further work on your part. Hope that helps.
ddf1230 posted this at 22:42 — 24th January 2006.
They have: 17 posts
Joined: Jan 2006
Oh, but you are so close. If the box was blank and didn't have a default sql statement in there, that's ok! In that case, just put
CREATE TABLE wfblog (
blog_id int(11) NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
content text NOT NULL,
published timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
display char(1) default NULL,
PRIMARY KEY (blog_id)
)
into the empty box and hit go. All done!
Win a free copy of Windows Vista
NewTechGuy posted this at 23:04 — 24th January 2006.
He has: 57 posts
Joined: Dec 2004
Okay, so.......you almost had me excited there.....LOL...
But I already tried that..... and just to make sure i tried it again with the code you recommended and believe it or not I got yet another error message....here it is:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
display char(1
Thanks again.....
ddf1230 posted this at 23:08 — 24th January 2006.
They have: 17 posts
Joined: Jan 2006
Ok, that I can't help you with. Might be a question for the developer who gave you the sql code to use. But you've got the procedure down now. Now, it's just a matter of having the right code. Good luck.
Win a free copy of Windows Vista
NewTechGuy posted this at 23:34 — 24th January 2006.
He has: 57 posts
Joined: Dec 2004
Hey,
Thanks again for your help.
I think what I'll do is look for a different script to use. It might be the final key I need since I've done almost everything else. Yeah that's it.... I'm on the hunt again....lol...
Thanks a million....you've been GREAT!
ddf1230 posted this at 00:40 — 25th January 2006.
They have: 17 posts
Joined: Jan 2006
If it's a blog you want, I'd recommend WordPress
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.