IPB

Welcome Guest ( Log In | Register )



Tags
This content has not been tagged yet
 
Reply to this topicStart new topic

Connecting Php Site To Database


veightar
no avatar
Newbie [Level 1]
*
Group: Members
Posts: 17
Joined: 12-July 07
Member No.: 46,371
myCENT:93.70



Post #1 post Sep 22 2007, 11:03 PM
Please Help Me with this site's error
http://gatewaybiz.x10hosting.com/surf/
Go to the top of the page
+Quote Post
jlhaslip
no avatar
Insert Custom Title Here
*********************
Group: [MODERATOR]
Posts: 5,022
Joined: 24-July 05
From: Linux, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol
myCENT:80.40



Post #2 post Sep 22 2007, 11:40 PM
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?
Go to the top of the page
+Quote Post
reconraiders
no avatar
Super Member
*********
Group: Members
Posts: 221
Joined: 6-June 07
Member No.: 44,288



Post #3 post Sep 23 2007, 12:30 AM
yeah, basically just check all your database info like user, password, db name, host, etc
Go to the top of the page
+Quote Post
veightar
no avatar
Newbie [Level 1]
*
Group: Members
Posts: 17
Joined: 12-July 07
Member No.: 46,371
myCENT:93.70



Post #4 post Sep 23 2007, 04:21 PM
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.
Go to the top of the page
+Quote Post
jlhaslip
no avatar
Insert Custom Title Here
*********************
Group: [MODERATOR]
Posts: 5,022
Joined: 24-July 05
From: Linux, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol
myCENT:80.40



Post #5 post Sep 23 2007, 04:37 PM
Add the prefix to both the db-name and the db-user-name.
Go to the top of the page
+Quote Post
veightar
no avatar
Newbie [Level 1]
*
Group: Members
Posts: 17
Joined: 12-July 07
Member No.: 46,371
myCENT:93.70



Post #6 post Sep 23 2007, 05:28 PM
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
[codebox]<?
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.".";[/codebox]
Go to the top of the page
+Quote Post
.hack//GU
no avatar
Premium Member
********
Group: Members
Posts: 190
Joined: 21-October 05
Member No.: 13,185



Post #7 post Sep 24 2007, 08:55 AM
QUOTE(veightar @ Sep 23 2007, 05:28 PM) [snapback]347484[/snapback]
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
[codebox]<?
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.".";[/codebox]


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...
Go to the top of the page
+Quote Post
iGuest
no avatar
Hail Caesar!
*********************
Group: Members
Posts: 5,876
Joined: 21-September 07
Member No.: 50,369



Post #8 post May 16 2009, 01:23 PM
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: localhost
Username: markud
Password: globalday
Database: orderlist
Table: 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.

Go to the top of the page
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No new   67 ravi 51,397 Today, 03:42 AM
Last post by: linekill
No new   26 football123213 29,546 31st October 2009 - 02:05 PM
Last post by: TheDarkHacker
No New Posts 7 A200 1,754 23rd October 2009 - 02:07 PM
Last post by: SpiderVV
No New Posts   9 KooL 12,242 2nd April 2009 - 11:04 AM
Last post by: varalu
No New Posts   13 chinfo 9,035 2nd August 2004 - 03:12 AM
Last post by: X3r0X
No New Posts   6 MSTR 15,160 16th August 2004 - 12:13 PM
Last post by: psp-playstation
No New Posts 8 psp-playstation 17,664 23rd June 2009 - 08:30 PM
Last post by: iworld200
No New Posts   9 cwalden 2,616 30th December 2008 - 05:03 PM
Last post by: rpgsearcherz
No new   23 CodeName_88 32,442 12th February 2010 - 06:17 AM
Last post by: alamstore
No new   14 Angelexi 18,731 23rd October 2009 - 12:50 PM
Last post by: TheDarkHacker
No New Posts   13 Evil Guy 3,569 23rd June 2009 - 08:15 PM
Last post by: iworld200
No New Posts 12 EricDrinkard 22,157 12th February 2010 - 06:22 AM
Last post by: alamstore
No New Posts   3 contactskn 392 21st January 2010 - 06:58 PM
Last post by: Soviet Rathe
No New Posts   10 djleli 19,863 21st January 2010 - 06:30 AM
Last post by: getube
No New Posts   3 rvovk 9,352 23rd June 2009 - 08:25 PM
Last post by: iworld200


 



RSS Open Discussion Time is now: 21st March 2010 - 05:07 AM

Web Hosting Powered by ComputingHost.com.
Xisto.com : HONESTY ROCKS! truth rules.
Creative Commons License