Jul 6, 2008

Connecting Php Site To Database

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Connecting Php Site To Database

veightar
Please Help Me with this site's error
http://gatewaybiz.x10hosting.com/surf/

Reply

jlhaslip
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?

Reply

reconraiders
yeah, basically just check all your database info like user, password, db name, host, etc

Reply

veightar
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.

Reply

jlhaslip
Add the prefix to both the db-name and the db-user-name.

Reply

veightar
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
CODE
<?
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.".";

 

 

 


Reply

.hack//GU
QUOTE(veightar @ 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
CODE
<?
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...

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. prefix - 289.54 hr back.
Similar Topics

Keywords : connecting, php, site, database

  1. Ms-access Database Question
    Allowing Web Access to the Informaton (3)
  2. How Do I Connect To Live Database With Php Script?
    while being hosted with ComputingHost (6)
    I am not new to programming. I want to create a form to add some values into my tables, the code
    are all working. But I am not sure what is the URL to connect to my site's database. All along,
    I have been testing through MAMP, which provides a local copy of mySQL. Can anyone lend me a hand?
    My site's URL is http://limetouch.com/ ....
  3. Xbox Gamertag Profile On Site
    (2)
    Alright, first off, sorry about the title, can't exactly explain it well. Basically, I want to
    have it so; 1. My users sign up on my website (easy enough, don't need help with) Now, this
    part might get confusing, but I need major help, as I see no way of doing it, yet I would love for
    it to happen. When they post on my website (comment), (this part I don't need help with), I
    wish for their gamer profile to show up under their name, so It'll say; Nate posted on (date):
    (gamer profile here) blah blah blah the trouble is, I have no idea how to get the ....
  4. Html Site With Login
    Is it possible? (2)
    Hello. I´m building my own site and I need some help... Is it possible to use a login sistem in php
    and mysql database in a html site? ....
  5. Can Database Column Names Start With A Number?
    Can database column names start with a number? (1)
    Can database column names start with a number or must they start with a letter like php vars? Like
    my_table.1fieldname ? Does this vary from db system to db system? Is it considered good/bad form? ....
  6. Displaying Your Phone Number On A Wap Site
    (3)
    I have a wap site elitezone.co.za and what i want to add is a code to the index page that displays
    your operator and phone number. Does any one know the coding for this function if so please show me
    here. Help will appriacated. Topic title modified. ....
  7. New Arisen Site Problem
    Nettek Login Trouble (2)
    Okay, so I installed Nettek and got everything set up. But every time I try and login, it says
    it's incorrect. I've gone into the Database and gotten the password and since it was
    simple, put them in and had tried but with no success. I tried changing the password but I still
    couldn't get in. I tried adding another login and it still didn't work. I have no idea
    what's wrong and I need some help.....
  8. Php Problems
    Clan Web site Problem (3)
    Okay, so I have an old version of Nettek that I would like to modify. There is a bug that when you
    get to the rank required for Set Rank, you can set your rank or other people's ranks to what
    ever you want, even Webmaster and that's something I'd like to not have. I am wondering how
    to fix the problem. What would I modify in the coding to set have it so you can only move people up
    to 1 rank below you at best? I'm still learning PHP and can't modify things like this quite
    yet.....
  9. Auto Pruning An Sql Database With Php
    How can i do this? (4)
    Hey all. Now i have a DB, an SQL DB, and i need to auto prune the data there to delete rows lder
    than a certain time, lets say 2 months for now, the question is how do i do this? The obvious thing
    is just to add a field which is the numerical representation of the month when the data is entered
    and every time the DB is accessed it will check this number against the current month,in a numerical
    format, and if the difference is two or greater that row is deleted, so if the month is January, it
    would be O1 and if the current month is march then it would be O3 and the diff....
  10. Use Bb Code On Your Site!
    Just like on forums! (7)
    To use this you must have PHP support on your server. Just use this code: CODE <?php
    $content = "Hello, World!"; $html = array('[b]',
    '[/b]', '[i]', '[/i]', '[u]',
    '[/u]'); $replacements = array ('<b>',
    '</b>', '<i>', '</i>', '<u>',
    '</u>'); $content = str_replace($html, $replacements,
    $content); ?&....
  11. Read Xml And Import Into Database
    question (2)
    hi all , i have one big problem i need to know , how i can read xml file and then save strings in
    xml in database for example its my xml CODE <?xml version="1.0"?>
    <numbers> <arash>1</arash> <kiarash>2</kiarash>
    </numbers> i want my soruce read this xml file and then save string into arash field in
    mysql database for example in this source arash string is " 1" and kiarash string is "2" my fields
    in mysql are standard and we have 2 field with names "arash" and "kiarash" please help me , if yo....
  12. Cms Opensource
    great cms reviews site (1)
    Hello... you can find great cms on http://www.opensourcecms.com <<< there you can find cms like
    mambo,joomla,wordpress,etc <<....
  13. Download Database Backup
    Download Database Backup (0)
    Hi all i want write backup system like Phpmyadmin export in single file , my question is what is
    backup query ? i must write manul query for backup for example loop query to get string form
    database and write into one file or php have backup query ? thanks /wink.gif"
    style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> ....
  14. Editing Information In A Mysql Database And Deleting Rows
    (5)
    I need help with a couple of things. First, I need to know how to retrieve information from a mysql
    database and edit it then re add it to the database. I also would like to know how to easily delete
    a mysql row. And I want this done without going to phpMyAdmin. Thanks for the help!....
  15. Importing .csv Into Mysql Database
    NEED HELP! (6)
    I need help importing a .csv contents into a Mysql database. I have this. But its not working.
    CODE <?php connection = mysql_connect("******", "**********",
    "********") or die ("Unable to connect to server"); $db =
    mysql_select_db("b9_259782_CC", $connection) or die ("Unable to select
    database"); fopen ('csvranks.csv', 'r');
    mysql_query("INSERT INTO test_table (id, name, guild, level, exp) ?> What
    am I doing wrong? The mys....
  16. Beginner's Php Tutorial Online At My Site
    (12)
    Hey everyone, over the last week I've been writing a PHP tutorial aimed at absolute beginners
    who have never even seen the syntax of PHP before let alone wrote a PHP script! The tutorial
    assumes you have a basic knowledge of HTML (for the tutorial you will need to write a couple of
    hyper links and forms, nothing complex!) and an internet browser. It tells you about where to
    find the other software needed (apache/XAMPP and a script.text editor) and how to check if it is
    working. The tutorial is basic and focuses on the use of the ECHO, INCLUDE/REQUIRE and I....
  17. Php Search Engine Script For Mysql Database
    (11)
    A search engine is provided to facilitate the user with undemanding and clear-cut search options.
    The search facility includes simple search, search by title, search by word/phrase, ect… Thus, the
    user is at a safe distance from the risk of selecting files/folders ambiguously. In addition, a
    history of recent searches can be preserved for future perusal. Now
    day’s visitors have a large option for his needs on internet and so visitors are not vesting their
    time by following the dead links on your site. So a search engine is essential for your....
  18. Problem To Join Tables In Database
    Problem in joining (many to many) relation (3)
    Please help me. I'm building a group of database fro a program. the situation is like this:
    'user' may have 1 or more class(es). 'class' itself may have 1 or more user in its
    classroom. I'm bad at explaining... maybe like this: A program is made to write data of
    classroom. Hikaru has a math class at Monday and statistic class at Tuesday. The math class itself
    consists of about 50 students in a classroom. So, Hikaru (user ) may have one or more class at
    time, math class (class) may have one or more students at time. So, basically I must mak....
  19. File In Database
    Question.thanks (1)
    Hi all i write this code i want when you see download.php (this code) my file goes for download for
    user sorry my english is not very good its a file database project for my university but when i
    browse this code my soruce file (.zip) echo in my page and dont goes for download my next querstion
    about safe mode i saw (php.net and zend) when safemode is on file databaseing and header() is not
    working . is it true ? if is it true i save my file at hosting and no (database) i want write
    standard script . plz help me thanks more and more CODE include("config.php&....
  20. I Need Webmail On My Server
    (so admins on my site can access it) (0)
    Right now, if i go to the cpanel of my site, I can access webmail of any of the email addresses I
    have. Unfortunatly, I would prefer it if the administrators did not know the password to the
    cpanel. I want them to be able to access mail from 1 of the email accounts. I have tried letting
    all the admins access the account through their own cliants, but it became a mess, not knowing wich
    admins have responded to which emails, because most emails are hosted localy when received by
    cliants such as outlook. Then I had the idea of making one page, with webmail on it. Where....
  21. Code To Install Mysql Database Table?
    (5)
    Can anyone show me example code of how to install a database table instead of me having to upload an
    file with it in, so i can do it from a php page? Thanks in advance ;-)....
  22. Wap Redirection
    Usefull code that all wap site owners should use! (12)
    Use this code to redirect pc users from your wap site to web site: include above page header this
    code: CODE <?php $mywebsite = "forum/index.php"; $browser = explode
    ('/', $HTTP_USER_AGENT); if($browser[0]=="IE"){
    header ('Location: $mywebsite');} ?> ....
  23. String Search Outside My Site?
    Help me work this out please ;-) (2)
    Hi ;-), i need some php code that will search any site or index page for a string. So i can check if
    my link is on sites it should be quickly?....
  24. Posting To An External Site Without Url Change
    need help (0)
    I need help with some PHP, once again. What I'm wanting to do is add something to an external
    database from a remote site. Say we are using the script farsiscript posted ( here ), and
    there's an added feature where it saves the information to a database, and it's on a
    different server. I want people to be on my site, enter the variables, and have the information
    submitted without knowing anything about the external site. Also, would there be a way of
    confirming whether the information was submitted, or if there was an error? Like if the result said
    "Than....
  25. The Downloads On My Site
    php (8)
    Ok i have a site with these downloads, when you click on them they do not open up to a new window.
    Instead it uses the same window and goes to the link that it was linked to go to. All of my
    downloads are made from being linked to some other site. Now my site is php, so i was wondering how
    i can make all links open up a new window to their download page without having to type out
    target="_blank" for all of them. Which would take awhile for me. I was wondering if there is a way
    to do that with the php download module where i can insert the target="_blank" in there so it w....
  26. Showing Numbers Of Mysql Entries In A Database Table
    It should be easy, but I don't know how... (7)
    I have a database, and need to know how to show the numbers of entries. So, if there are 10 entries
    in the selected database table, it will show the number 10 . I'm pretty sure this should be
    easy, but I don't know how to do it. Can someone tell me? /smile.gif"
    style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />....
  27. Good Script Site
    Plz Write Good Script Site Here! (6)
    Hi all I write script and i want to know which Script site for release Script is best Some sites ::
    www.hotscripts.com www.scripts.com http://www.yourscripts.net/ http://www.popscript.com/ If You
    know more Url plz post here . thanks all....
  28. Too Many Connections Created In Mysql By My Site
    (4)
    Hi i am hosted at computinghost (which is great btw) but my site is causing mysql to hang because
    it is flooded and it causes my account to be suspended alot.. What is confusing is that not many
    users (7) are only when it happens and it is not a deliberate flooding. The mysql proccesslist when
    it gets too many connections: QUOTE | 7971 | andre_krap | localhost | andre_wap | Query | 439
    | Sending data | SELECT unread,sentby,id FROM private WHERE sentto='Candi.Boi' ORDER BY
    id DESC LIMIT 0,15 | | 7973 | andre_krap | localhost | andre_wap | Query | 2 ....
  29. Login / Authetication System Using Database
    adding information (4)
    Is there any way to make such database where I can write like name and passwords.. Then make an
    login box, and when somebody trys to acces the login he needs to write the name and password.. Then
    it is verifyed if is there such name and password and if it is then acces the page.. I think there
    is posible something like that with MySQL (db).. but can anybody say me a script or way to make
    something like that? Alredy thanks......
  30. Can You Add Images Into A Mysql Database?
    Using Php? (20)
    I'm learning php in class right now, but I'm still not that good at it, what I'm
    wondering is when I write the php so that it can connect with a database, can I at the same time
    have it that it is able to display back images that I choose. Like, I want a search feature, where
    you can search for a keyword, and it will bring back a list of all the possible entries with that
    keyword, but each of these entries will have a photo associated with it. Now, do I put these image
    files directly into the database, or do I write the code to link them from my files to th....

    1. Looking for connecting, php, site, database

Searching Video's for connecting, php, site, database
Similar
Ms-access
Database
Question -
Allowing Web
Access to
the
Informaton
How Do I
Connect To
Live
Database
With Php
Script? -
while being
hosted with
ComputingHos
t
Xbox
Gamertag
Profile On
Site
Html Site
With Login -
Is it
possible?
Can Database
Column Names
Start With A
Number? -
Can database
column names
start with a
number?
Displaying
Your Phone
Number On A
Wap Site
New Arisen
Site Problem
- Nettek
Login
Trouble
Php Problems
- Clan Web
site Problem
Auto Pruning
An Sql
Database
With Php -
How can i do
this?
Use Bb Code
On Your
Site! -
Just like on
forums!
Read Xml And
Import Into
Database -
question
Cms
Opensource -
great cms
reviews site
Download
Database
Backup -
Download
Database
Backup
Editing
Information
In A Mysql
Database And
Deleting
Rows
Importing
.csv Into
Mysql
Database -
NEED
HELP!
Beginner'
;s Php
Tutorial
Online At My
Site
Php Search
Engine
Script For
Mysql
Database
Problem To
Join Tables
In Database
- Problem in
joining
(many to
many)
relation
File In
Database -
Question.tha
nks
I Need
Webmail On
My Server -
(so admins
on my site
can access
it)
Code To
Install
Mysql
Database
Table?
Wap
Redirection
- Usefull
code that
all wap site
owners
should
use!
String
Search
Outside My
Site? - Help
me work this
out please
;-)
Posting To
An External
Site Without
Url Change -
need help
The
Downloads On
My Site -
php
Showing
Numbers Of
Mysql
Entries In A
Database
Table - It
should be
easy, but I
don't
know how...
Good Script
Site - Plz
Write Good
Script Site
Here!
Too Many
Connections
Created In
Mysql By My
Site
Login /
Autheticatio
n System
Using
Database -
adding
information
Can You Add
Images Into
A Mysql
Database? -
Using Php?
advertisement



Connecting Php Site To Database



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE