phpmyadmin

Did this help you or where you the helper?

  • no not really

    Votes: 0 0.0%
  • I was the helper

    Votes: 0 0.0%

  • Total voters
    4
  • Poll closed .

kimacc

New Member
Messages
9
Reaction score
0
Points
0
I'm trying to set up a guest book on my site is there a tutorial for beginners on how to do this on this site somewhere because im not finding it
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
I haven't seen one on X10's site. However, if you use Softalicious from your CPanel, it will do all of the work for you. If you don't like any of the scripts in Softalicious, just do a google search for something like "free php mysql guestbook" and if you see one you like, post back here and we can help you install it.
 

kimacc

New Member
Messages
9
Reaction score
0
Points
0
I think i have one made but im now getting an error of something like cant connect nopassword. I dont want people to have to register to sign the guestbook, anyone can sign.. Im thinking its just because i dont have the localhost part right.. what do i need to change it too.. here is part of my code..

$connect = mysql_connect("localhost","root","") or die ("error");


if i cant figure this out i will try to use the site script, i tryed yesterday but it wouldnt let me go to that page for some reason...
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
in your sql connection the username and password has to be changed. On x10 when you creating database you have to create a user and give permission and associate to the perticular database.


place the corresponding username and password in the mysql_connect command.
 

kimacc

New Member
Messages
9
Reaction score
0
Points
0
how do i go about making the pw and user name if i already created the database??

also can you give me a dummy view of what it would look like on mysql_connect??
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
in your control panel select mysal databses , there you can see the created databases and in the down htere is an option to create user, Create one and associate it with corresponding database.

Regarding mysql connect use this way.

Code:
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'Database Name');

DEFINE ('DB_USER', 'Database user');
DEFINE ('DB_PASSWORD', 'Databse Password');

// Make the connnection and then select the database.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
 

kimacc

New Member
Messages
9
Reaction score
0
Points
0
Error selecting db, i posted what i changed.. Im so close now thanks but im still getting that error...oh and i did make the usernam and password and gave all priviages..

Code:
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'changed_changed'');// I canged this to my db name right??
 
DEFINE ('DB_USER', 'myaccount');//changed
DEFINE ('DB_PASSWORD', 'password123');//changed
 
// Make the connnection and then select the database.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
 
Last edited:

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
Error selecting db, i posted what i changed.. Im so close now thanks but im still getting that error...oh and i did make the usernam and password and gave all priviages..

Code:
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'changed_changed'');// I canged this to my db name right??
 
DEFINE ('DB_USER', 'myaccount');//changed
DEFINE ('DB_PASSWORD', 'password123');//changed
 
// Make the connnection and then select the database.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );

One more thing you should remember your db and usernames are always associated with cpanel name

like for example your database name is test the it should be cpanelusername_test and same for dbusername
 
Last edited:

kimacc

New Member
Messages
9
Reaction score
0
Points
0
thats how i have it set up i think, or do i need to put cpanel, i can post my actual code but i just dont want other people to be able to see it like right now it is kimacc_phpacadamy. or should it be kimacckimacc_phpacadamy???
Edit:
ok i think i know what the problem is it didnt create the username and password, it says "No users associated with this account"

the drop down bocks for users is blank and wont let you type 1 user in... but im think that should be default of 1 anyways
DeleteThere are no users associated with your account.
DeleteThere are no users associated with your account.
 
Last edited:

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
thats how i have it set up i think, or do i need to put cpanel, i can post my actual code but i just dont want other people to be able to see it like right now it is kimacc_phpacadamy. or should it be kimacckimacc_phpacadamy???

Ok

I undestand you are confusing between forum username and cpanel username


I am talking about about the user name where you to login into your cpaenl.

like using http://<yourserver>.x10hosting.com:2082

Then you will give username right that i am talking about.

If i am not wrong then it will be kimacckimacc_phpacadamy In this kimacckimacc is your cpanel username and acadamy is databse name right and also the username willl be kimacckimacc_<username> what ever you created and granted privillages


EDIT:

Your said "oh and i did make the usernam and password and gave all priviages.."

Ok give that username here
 
Last edited:

kimacc

New Member
Messages
9
Reaction score
0
Points
0
kimacc is my cpanel username phpacadamy is the data base, when i go to the data base is says kimacc_phpacadamy...

i edited my other post so please read it.. thanks for helping me...
Edit:
ahhh i figured it out i didnt creat the user and password, i made it but clcik on add instead of make the user, if you understand...
 
Last edited:

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
Ok

In your previous post you said you created the username and password and given privileges right. That user has to be used here.

That is also in the format of kimacc_<username>
 

kimacc

New Member
Messages
9
Reaction score
0
Points
0
ok still getting error now
Code:
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'kimacc_kimacc_phpacadamy');
DEFINE ('DB_USER', 'kimacc');
DEFINE ('DB_PASSWORD', 'brianna123');
// Make the connnection and then select the database.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );

i hope you havent read my other messages yet cuz i dont have it.. when i get this done im writing tutorial on this, lol...
Edit:
Manage User Privileges

User: kimacc_kimacc
Database: kimacc_phpacadamy

----
this is my user and database if this helps you out any
 
Last edited:

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
What are the errors you are getting, Can you post them here.

Generally procedure is

Create a DB
Create mysql user
grant privileges and associate to a DB

You said the cpanel username is kimacc
DB name is you given while creating is acadamy then here it will be kimacc_phpacadamy

same for username

username will be kimacc_kimacc First part is cpanel username and second part is username given in creating mysql user text field.

password is normal what ever you given there


EDIT

Code:
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'kimacc_phpacadamy');
DEFINE ('DB_USER', 'kimacc_kimacc');
DEFINE ('DB_PASSWORD', 'brianna123');
// Make the connnection and then select the database.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );

it becomes.

Small advice you should change Password. once it started running perfectly.
 
Last edited:

kimacc

New Member
Messages
9
Reaction score
0
Points
0
i have it just like you have it now and im getting this "Error selecting db"
Edit:
i think my error is comming from this point
//select table
mysql_select_db("kimacc_phpacademy") or die ("Error selecting db");
//use query to get ALL data
$queryget = mysql_query ("SELECT * FROM guestbook")or dir ("Error w/ query");
//get row data and store in variables
while($row = mysql_fetch_assoc ($queryget))
 
Last edited:

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
i have it just like you have it now and im getting this "Error selecting db"

Everything looks ok here.

created the databse.
Created the mysql username and password
associated the dtabase and mysql username with all prvilleges.

In the code

mysql_connect is connecting.

mysql_select_db is giving error.

why?


Can you make small changes. Remove all and re create the databse with small name
give small username and associate it with it.

Use phpmyadmin to confirm everything is ok and create a sql table.


In the code remove the @ symbol infront of mysql_connect.

I don't think so these are creating problems. But just checking.

Lets see,
 

kimacc

New Member
Messages
9
Reaction score
0
Points
0
it is totally working now, i dont understand that, thanks a million man you where great and thanks for not getting frustrated with me... I took the @ out before i redid everythang and it was still the same but i left it out with the new and it worked....
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
it is totally working now, i dont understand that, thanks a million man you where great and thanks for not getting frustrated with me... I took the @ out before i redid everythang and it was still the same but i left it out with the new and it worked....

No problem. It is working now, good to hear that. Good luck in improving your site.
Anything more help post here in forums. :)
 
Top