Jump to content
xisto Community
veightar

Connecting Php Site To Database

Recommended Posts

No-one here can help you, except to suggest that you check, and confirm with the Hosting company, that you are using the correct user-name and password, and that you are attempting to open the correctly named database.That is what the error suggests. Answer these questions so we an be of more service to you:What script are you installing? Are you allowed databases on that service? Do they add a prefix to our DB name when you create the DB?Did you include the prefix?

Share this post


Link to post
Share on other sites

Thank you Guys. Actually my hosting user name is makj and have a db and indeed adds a prefix to my db user name.
I created a db with a named blog and a user name surf. My hosting added the the prefix making the db makj_blog and the username makj_surf. I don't really know whether to include the prefix makj when setting up the script. In the page I showed, I added the prefix makj to it. Should I add the prefix makj to the username or db?
I am indeed installing a surfing script

http://gatewaybiz.x10hosting.com/surf/

Once again thank you.

Share this post


Link to post
Share on other sites

I very much appreciate this help. thank you and I'll try that but before then, Please take a look at the file that is mentioned in the page ie. require.inc.php and help me with the changes I need to make in

<?global $username;require 'dconn.php';session_start();$username = @$_SESSION["username"];$connection = mysql_connect($db_server, $db_user,$db_pass) or die(mysql_error());mysql_select_db($db_name, $connection) or die(mysql_error());// A few important variables to set$title = "Gateway SuperSurf";$motto = "Free hits without the bandwidth";$siteUrl = "http://gateway.x10hosting.com/surf/;; // remember to include the end slash$contact_email = "support@gateway.x10hosting.com";$paypal= "mickeyaff@yahoo.com";$emailFooter = " - You are receiving this email because you are currently a member of ".$title.".";

Share this post


Link to post
Share on other sites

I very much appreciate this help. thank you and I'll try that but before then, Please take a look at the file that is mentioned in the page ie. require.inc.php and help me with the changes I need to make in

session_start();

$username = @$_SESSION["username"];

$connection = mysql_connect($db_server, $db_user,$db_pass) or die(mysql_error());
mysql_select_db($db_name, $connection) or die(mysql_error());

// A few important variables to set
$title = "Gateway SuperSurf";
$motto = "Free hits without the bandwidth";
$siteUrl = "http linenums:0'><?global $username;require 'dconn.php';session_start();$username = @$_SESSION["username"];$connection = mysql_connect($db_server, $db_user,$db_pass) or die(mysql_error());mysql_select_db($db_name, $connection) or die(mysql_error());// A few important variables to set$title = "Gateway SuperSurf";$motto = "Free hits without the bandwidth";$siteUrl = "http://gateway.x10hosting.com/surf/"; // remember to include the end slash$contact_email = "support@gateway.x10hosting.com";$paypal= "mickeyaff@yahoo.com";$emailFooter = " - You are receiving this email because you are currently a member of ".$title.".";

how about db_server variable? From what I know, this variable is the one many people have mistaken. You have to confirm with your database server contact, so you can connect them.

Or even your user I guess...

Share this post


Link to post
Share on other sites
UNABLE TO DISPLAY DATA ON LOGGING INTO MYSQL DATABASE.Connecting Php Site To Database

Hello dear Friends,

I am new to php scripts with a below average understanding. I`d be glad to be assisted in the following way:

1). Pls I need a php code that can log into the below stated database and display single rows from the table using the username and password given each time only for authentication.

2). And also after login in, how can I prevent someone from using the logged in sites page url to view the page without signing in with their username and password.

3). I can design forms and validate with dreamweaver, but I am not able to display the results from the database. I`ve been trying this for over a month now and just need help greatly. E.G, after login into the database using the username "dandy" and password "53423", I want to get the following single row (and column headers) displayed too:

============================================================|_Username _|_ Password_ |_ _Age_ _ | _ _State_ _ |_ _Inv. No._ _ | _ _Day Ord._ _ |============================================================|_ _dandy_ _ |_ _53423_ _ |_ _67_  _ | _ _NC_ _ |_ _000013_ _ |  _ _ _Wed_  _ _ |

The rows will be displayed in a php page. I have attempted to use dreamweaver to solve the problem, but the php scripts written by dreamweaver were not successful in the task.

4). Also, how do I prevent someone that has logged in from using using the back button to navigate out of his account and back again?; which might not be secured in case he leaves his session logged on mistakenly.

5. WHAT I NEED IN ESSENCE, IS HOW "DIIFERENT CLIENTS" CAN SECURELY LOG INTO A DATABASE FROM THEIR WEB BROWSER AND VIEW THE DISPLAYED AND REQUIRED ROW(NOT COLUMN ONLY) RESULTS ON THEIR WEB PAGE!

The following details are given for the php codes:

Server: localhostUsername: markudPassword: globaldayDatabase: orderlistTable: invoice

 == I and V O I C E ==   =======================================================   |_Username _|_ Password_ |_Age_ | _ _State_ |_ _Inv. No.  _ | _ _Day Ord._ _ |   =======================================================A. |_ _jenny_  _ |_ _23453_ _ |_46  _ |  _ _GA _ |_ _000001_ _ |  _ _ _Wed_ _ _ | B. |_ _gregg_  _ |_ _07867_ _ |_55 _ | _ _OH _ |_ _000043_ _ | _ _ _Tue_ _ _ _|

C. |_ _dipoe_  _ |_ _89787_ _ |_28 _ | _ _NY _ |_ _000401_ _ |_ _ _Thu_ _ _ _ |

D. |_ _tsoni_ _ |_ _62239_ _ |_32 _ | _ _CA _ |_ _000765 _ _ |_ _ _Mon  _ _ _|  E. |_ _dandy_ _ |_ _53423_ _ |_67 _ | _ _NC _ |_ _000013_ _ |  _ _ _Wed  _ _ |

F. |_ _veron_ _ |_ _37342_ _ |_34 _ | _ _TX   _ |_ _000038 _ _ |  _ _ _Sat_ _  _ |

G. |_ _lucas_  _ |_ _67552_ _ |_43 _ | _ _MO  _ |_ _000009 _ _ |  _ _ _Fri_ _ _ _|

(You can disregard the row alphabet labeling I.E A., B., C., D. Etc).

I will be grateful if this can work properly as soon as possible. And any other advice - general or particular; I can get in php scripting or software that could write good php codes.

I will give credit and acknowledgements for helping me out.

Thank and I appreciate a positive response in advance.

Mark.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.