Nov 21, 2009

Please Explain Me Mysql - How do i insert information into this config:

free web hosting
Open Discussion > Xisto Network Sites > Support and Feedback > Questions & Queries

Please Explain Me Mysql - How do i insert information into this config:

vasilevich
Hi, I wanted to try just to test how can i connect my website to another mysql server, but i have no idea how to insert the other mysql information such as port and host etc.... so here is the config file please give me an example

CODE
<?php
// mySQL information
$server = 'FRESHSQL.COM:3306';                   // MySql server
$username = 'vasilevich';                      // MySql Username
$password = '*******';                         // MySql Password
$database = 'vasilevich';                  // MySql Database

// The following should not be edited
  $con = mysql_connect("$server","$username","$password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("$database", $con);

//mysql_query("UPDATE ava_games SET height='300' WHERE height='0'") or die (mysql_error());

//
$sql = mysql_query("SELECT * FROM ava_settings");
$row = mysql_fetch_array($sql);
$site_name = $row['site_name'];
$site_url = $row['site_url'];
$seo_on = $row['seo_on'];
$template_url = $row['template_url'];
$max_results = $row['max_results'];
$image_height = $row['image_height'];
$image_width = $row['image_width'];
$adsense = $row['adsense'];
$cat_numbers = $row['cat_numbers'];
$email_on = $row['email_on'];
$add_to_site = $row['add_to_site'];
$plays = $row['plays'];
$new_plays = 4;
//

// Convert super globals
if (phpversion() >= '5.0.0')
{
    $HTTP_POST_VARS = ($_POST);
    $HTTP_GET_VARS = ($_GET);
}
?>($_GET);
}
?>



here is the information i would like to insert:
Database:vasilevich
username: vasilevich
host:FRESHSQL.COM
PORT:3306
password is annymouse but i would still like you to include this password as an example: *******
The mysql server is at this site:http://bluesql.net Thank you for the help!

 

 

 


Comment/Reply (w/o sign-up)

truefusion
QUOTE(vasilevich @ Jun 24 2008, 09:14 AM) *
here is the information i would like to insert:
Database:vasilevich
username: vasilevich
host:FRESHSQL.COM
PORT:3306

You don't (normally) insert that information into the database: it remains in the PHP document. It doesn't need to be in the database in order to connect to the database. And try not to give away your passwords.

Comment/Reply (w/o sign-up)

vasilevich
QUOTE(truefusion @ Jun 24 2008, 01:20 PM) *
You don't (normally) insert that information into the database: it remains in the PHP document. It doesn't need to be in the database in order to connect to the database. And try not to give away your passwords.

as you see i changed my password with "******" in that way i didn't gave any of my passwords, i just need a good example on how to insert the mysql information into the config.php file of my website thank you.here is the config.php file if you would like to see what i mean. i don't mind of the password as its the password of a mysql server not from trap17, i don't mind it is just for testing purpose i need example of how to insert a mysql information into config.php from a distant hosting sql. [attachment=1181:config.php]

Comment/Reply (w/o sign-up)

truefusion
QUOTE(vasilevich @ Jun 24 2008, 09:28 AM) *
i just need a good example on how to insert the mysql information into the config.php file of my website thank you.

That's different from what i understood in your previous post. But in order to edit a file in PHP, you need to use fopen, fwrite and fclose (PHP4) or file_put_contents (PHP5). You must also make sure the file is editable by chmodding it either 666 or 777. After editing the file, make sure to chmod it back to 644.

Comment/Reply (w/o sign-up)

vasilevich
QUOTE(truefusion @ Jun 24 2008, 01:36 PM) *
That's different from what i understood in your previous post. But in order to edit a file in PHP, you need to use fopen, fwrite and fclose (PHP4) or file_put_contents (PHP5). You must also make sure the file is editable by chmodding it either 666 or 777. After editing the file, make sure to chmod it back to 644.

i am very sorry for that many questions but look what i mean, for example, at a web hosting that provide free mysql serviece along their web host they offer those informations:
host: sql.examle.com
username:myusername
database: databaseofmychouice
password:passwordofmychoice
that was the information that i acctualy inserted in the config.php file to make it work, but when i want to try another sql server, not on the same host as the example i gave http://bluesql.net
when i register on a distant sql server that has no web hosting, they also offer for example, host=sql.example.com port=xxxx i don't understand what to do with the port, as usually the mysql hosters on my web host do not need port information to connect to them. Thank you for your help.

 

 

 


Comment/Reply (w/o sign-up)



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*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : explain, mysql, insert, information, config,

  1. Mysql Database Space
    (3)
  2. Mysql
    administration (5)
    QUOTE Using your MySQL administration tool that your web host has, check to see if the table was
    created correctly. Afterwards, try creating a few of your own tables to be sure that you have gotten
    the hang of it. Where is the MySQL administration tool on trap17 O_o, i can't find it.....
  3. External Access To Mysql Database
    game plugin (0)
    hello guys, me again /wink.gif" style="vertical-align:middle" emoid=";)" border="0"
    alt="wink.gif" /> since i make plugins for the steam-platform games, i mostly use databases for
    storing data on like people's steamid and nickname for frequent visitors or banned people all
    the other hosts i visited never allowed external access to the database i wonder if it's allowed
    here but i wouldn't want to make the database server crash, since the database i would use
    would get a lot of traffic every time a player joins a server or a ban happens with the global c....
  4. I Cannot Connect To Mysql
    Can't connect to database (1)
    I am trying to install an excellent mailing list program called poMMo - written in PHP. I keep
    getting the below message and am not sure how to fix it. Connected to database server but could not
    select database: "jeldi_pommo". jeldi_pommo is the name of my database. It works. I've checked
    in phpMyAdmin through cPanel. It says it's connected to the MySQL server, so it cant be
    user/pass issues. If anyone has any ideas, they would be much appreciated. I'm genuinely
    stumped!....
  5. Fantastico Difficulties
    Mysql or fantastico problems ??? (1)
    Yes, even frantastico ain't working and my AMFR forum hosting system is down. Please get it
    fixed!....
  6. Which Mysql Version Does Trap17 Offer?
    Please clarify this for me (4)
    I am trying to set up something that requires a Mysql database. I have made the account and user for
    it and everything is OK, I just need to know what MySQL database type Trap17 offers to be able to
    continue. I can select MySQL types between: 1. MySQL 3.x 2. MySQL 4.x/5.x Please help verify which
    of these two Trap17 hosting package #2 offers /wink.gif" style="vertical-align:middle" emoid=";)"
    border="0" alt="wink.gif" /> James....
  7. Mysql Help Needed
    (2)
    Right, where do I start... I have a phpbb forum, which is ok but doesnt give me the scope for
    expansion which I need, so I have switched over to phpnuke (which has phpbb integrated anyway). My
    problem is this - how do I transfer all the member details from the phpbb forum to the phpnuke
    database? I'd really rather not have to ask everyone to rejoin if it can be helped, & I guess
    there must be some clever way of using the mysql database to sort it out. I'll be the first to
    admit i'm pretty clueless when it comes to the finer workings of mysql databases, so ....
  8. Mysql Only
    (2)
    Would I be allowed to use my hosting account for MySQL only (no site)?....
  9. Mysql And Free Hosting
    (8)
    with the free hosting can I have a MySQL database and run PHP for a forum....
  10. Looking For Free Hosting With Mysql, Php And More
    I need help!!!! (4)
    I am trying to find a website hosting server which is totally free with mysql and php and ahs alot
    of megabyte storage If any one can help me please email me at ichhabezwei@hotmail.com....
  11. Trap17.com Mysql Databases
    Addresses, inquiry (2)
    What is the SQL host address for trap17.com? example, google's could be db1.google.com. I am
    looking for that address for trap17.com. Thanks, htdefiant....
  12. Problem With Php
    anything that accesses a mySQL database (8)
    Hey. I'm having a problem with PHP, when I have a script access a database, it comes back
    blank... I was wondering why this happens and what I could do to fix it or if any of you could fix
    it. Yes, everything else in PHP works, Yes, I have tested this on multiple computers. Thanks for
    the help /wink.gif' border='0' style='vertical-align:middle' alt='wink.gif' /> ....
  13. Mysql Help
    (1)
    I tried to upgrade my coppermine photogallery by usiing fantastico, and but then it gave me an
    error.. i tried to follow their instructions to reinstall the backup, but i need help. If you
    don't have SSH access, ask support to help you: - Remove the directory
    /home/blah1234/public_html/forum - Untar
    /home/blah1234/fantastico_backups/forum.backup.1132357531.tgz - Empty the database blah1234_smf1 -
    Import the file /home/blah1234/fantastico_backups/forum/backup.sql into the database blah1234_smf1 -
    Move /home/blah1234/fantastico_backups/forum to /home/blah1234/public_h....
  14. Free Mysql Hosting
    Sql Hosting info. (6)
    Can anyone tell me , do trap17 site will give me mysql hosting for phpbb forums, WITHOUT Ads, How
    many points i will need and for how long time they will give web hosting? For one year or less ? Let
    me know.Thanks. Or if you guys can tell me any other site which gives free mysql hosting without any
    ads on forums..I will be thankful to you.....
  15. Mysql Database Size
    related to the free database space (7)
    hi all! this is my first post /biggrin.gif' border='0' style='vertical-align:middle'
    alt='biggrin.gif' /> and i have a doubt, how much mysql space i am allowed to use... i mean how
    much is available for my free account....
  16. Php & Mysql Help
    need some help (2)
    I'm not sure whether i should have posted this here, but anyway. I am making an email-like
    system. I have a table that reads the "id", "subject", "author" and "date" off a mysql table.
    let's say that there are 15 messages in the table, but when i delete all the messages using a
    php script then post a new message the "id" sets itself to 16 instead of 1, the only way i have
    figured out is to Truncate the table and just fake it for now, and not allow deleting. I think i
    have to add in an update mysql table or something - how do i do this? if you would like to see in....
  17. Lost Connection To Mysql Server During Query
    (0)
    Hello Everyone... I need to put in the images table of the DB, 10 pictures of 60kb each one, when i
    do that, i lost the connection, but if a upload 10 pictures of 10kb each one, i haven't got the
    problem. I'm getting the following error when I run my select query within my VB code: Lost
    connection to MySQL server during query. This seems like a timeout error to me, but I don't
    know how to compensate so that it doesn't time out. I read in some places that there is a
    max_alloweb_timeout or something, that is set by the Hosting Provider, so Any sugge....
  18. Account Creation Ii
    Not working or not enough information (5)
    I requested a hosting with 33 hosting credits. How do you notice when is ready to put data? The
    cpanel link appears automatically in "USERCP"? How do I configure the e-mail accounts? Thanks.....
  19. Mysql Problems....
    (4)
    Is MySQL currently working proper? Well, my site seems to be down because of it. and went to my
    CPanel and I was supposed to have 2 MySQL databases, but it says 0/99 /blink.gif' border='0'
    style='vertical-align:middle' alt='blink.gif' /> Does anybody have any idea of why is that? it
    would be really helpful if someone tells me if its a general problem-situation. thanks ps. BTW, my
    site is www.sonorama.net....
  20. Login And Registration Mysql Problems
    Session terminates too quickly (2)
    Although I'm doing some tweaking, I have finally got just about everything down in developing a
    login feature to my website, but just one problem. The session terminates too quickly. For
    instance, someone will be instructed to login, and after browsing a couple pages, it'll come up
    again that the user is not logged in. In addtion, this occurs frequently but not all the time.
    What can I do that will eliminate this inconvience to my viewers?....
  21. Help With Php And Mysql Database
    Can't figure it out... (2)
    I've been asking for a lot of help lately cause I'm rather new to all of this stuff.
    I'm trying to encorporate log in and registrating pages to the website. I've looked at
    tutorials on the forum and others on the net. My biggest problems is connecting successfully to the
    databases I set up for the installation of this feature...I just can't seem to get it right.
    Does anyone know of database tutorials on the web or on the forum I may not have found? If someone
    would like to help and needs specific info on my problems I can detail it...I'm real....
  22. Help For Java Applet
    Can I insert a JFrame into a JApplet (-1)
  23. Upgrade
    someone can to explain me? (0)
    I: a few days ago i request for package 3, my upgrade was approved but Administrator say to me
    what i have post at least i have 20 credits, in that moment i have 12 credits, then when i link in
    the upgrade its took 10 credits and rest 2 credits in my count, but i still have 50 mb, (not 100)
    Now i have 12 credits, what can i do for upgrade to package 3? Regards Santiago Argilla Sargilla
    Web La Página de los Bandoneonistas www.sargilla.com.ar ....
  24. Mysql Server Problem
    MySQL Server problem (3)
    Hi: When i enter in my webpage it appears the following message: "There seems
    to be a problem with the MySQL server, sorry for the inconvenience. We should be back shortly." But
    my cpanel work rigth, the problem with mySQLserver is mine or general? Regards Tiago....
  25. Mysql Phpbb Critical Error?
    (6)
    Warning: mysql_connect(): Too many connections in /home/ill/public_html/void/db/mysql4.php on line
    48 Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in
    /home/ill/public_html/void/db/mysql4.php on line 330 Warning: mysql_errno(): supplied argument is
    not a valid MySQL-Link resource in /home/ill/public_html/void/db/mysql4.php on line 331 phpBB :
    Critical Error Could not connect to the database Can anyone tell me what this error is? I've
    got it before but it somehow fixed itself but now it's back??....
  26. Mysql Hostname?
    where can i get it (4)
    Hey, im looking at a php script to connect to mySQL - it requires the password, username and
    hostname to connect to the database. Im now looking at it in a very perplexed way. Ive looked on
    cpanel but I can't see anything like this anywhere. Where can I find this information? If this
    is nothing to do with you at all I'm very sorry for wasting your time.... Please be gentle, im
    only a n00b /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" />
    Thanks very much guys You do great work, keep it up!....
  27. Mysql Down
    My sql is down T_T (5)
    well, my mysql databases won't work /sad.gif" style="vertical-align:middle" emoid=":("
    border="0" alt="sad.gif" /> QUOTE Warning: mysql_connect(): Too many connections in
    /home/danieluc/public_html/bloggie/b2-include/b2functions.php on line 37 Can't connect to the
    database server. MySQL said: Too many connections and i can't log in to my Cpanel o_o.. is
    this normal? it's part of your upgrades?....

    1. Looking for explain, mysql, insert, information, config,

Searching Video's for explain, mysql, insert, information, config,
See Also,
advertisement


Please Explain Me Mysql - How do i insert information into this config:

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com