Jump to content

Root -/local host folder?


eduard

Recommended Posts

I don't if this applies to your situation, But! the password, host name, database you use on your local server, DO NOT usually match those used on your hosts server, they usually define the host name, database name for you to use.

Link to comment
Share on other sites

I don't if this applies to your situation, But! the password, host name, database you use on your local server, DO NOT usually match those used on your hosts server, they usually define the host name, database name for you to use.
I understand, but I´ve only used phpMyadmin with the information of my local host! and why does the data goes into my db off-line? Edited by eduardlid
Link to comment
Share on other sites

IF your host supply hostname etc, you have to change you settings for those in mysql_connect("localhost","root","usbw") to match, BUT! you would define the password to use, and should have setup the password to a specific database to use, which SHOULD provide the hostname, username details to use with that database.

Link to comment
Share on other sites

why does the data goes into my db off-line?
Because YOU define what the database will be called, YOU can define Host name, YOU can define Username, You can define the password on YOUR local webserver. BUT! you are restricted in doing that on your hosts webserver, as they have to keep track of database names, hostname etc, SO THEY define DB names etc you can use. What you should do, is get the database, hostname etc setup on you hosts server, and then use identical db name, hostname, username, password on you local server, then when/IF everything runs as it should on localserver, you would just transfer the files over, and because access details to database are identical you should connect straight away.
Link to comment
Share on other sites

Guest So Called
What you should do, is get the database, hostname etc setup on you hosts server, and then use identical db name, hostname, username, password on you local server, then when/IF everything runs as it should on localserver, you would just transfer the files over, and because access details to database are identical you should connect straight away.
Good idea!
Link to comment
Share on other sites

Because YOU define what the database will be called, YOU can define Host name, YOU can define Username, You can define the password on YOUR local webserver. BUT! you are restricted in doing that on your hosts webserver, as they have to keep track of database names, hostname etc, SO THEY define DB names etc you can use. What you should do, is get the database, hostname etc setup on you hosts server, and then use identical db name, hostname, username, password on you local server, then when/IF everything runs as it should on localserver, you would just transfer the files over, and because access details to database are identical you should connect straight away.
Do you mean phpmyadmin via the cPanel of my host and transfer the files is this via ex-/import? What I intend to do is going to this phpmyadmin and make there a db and a table with identical names as the local host (or is that the same?)
Link to comment
Share on other sites

Fine! IF you CAN use you CPanel phpmyadmin to create identical database, identical tables, identical hostname, identical username, identical password used on your localserver then YES! if you can do that! and you place files in identical locations from local server to locations on your online server, it WILL work.

Link to comment
Share on other sites

Fine! IF you CAN use you CPanel phpmyadmin to create identical database, identical tables, identical hostname, identical username, identical password used on your localserver then YES! if you can do that! and you place files in identical locations from local server to locations on your online server, it WILL work.
But to make connection with this db in the insert.php I have to change ´local host´ in ?, username (of my host?), password (of my host?)?
Link to comment
Share on other sites

Guest So Called

Or use include files defining your database configuration. The file name is the same on both shared hosting service and local host, but the contents of the files are different. Each has the correct database name, user name, password, etc. as appropriate. That seems a lot easier than needing to make the database names and all the rest of the stuff identical. On my shared hosting service the only thing I pick is the password. cPanel sets all the other stuff to the hosting service preferences. I have assumed this is the usual setup, so that separate customers won't accidentally pick the same database names. (Or on purpose for that matter.)

Link to comment
Share on other sites

Or use include files defining your database configuration. The file name is the same on both shared hosting service and local host, but the contents of the files are different. Each has the correct database name, user name, password, etc. as appropriate. That seems a lot easier than needing to make the database names and all the rest of the stuff identical. On my shared hosting service the only thing I pick is the password. cPanel sets all the other stuff to the hosting service preferences. I have assumed this is the usual setup, so that separate customers won't accidentally pick the same database names. (Or on purpose for that matter.)
This I don´t understand! What are include files?
Link to comment
Share on other sites

Don't worry about it. Figure out what you're supposed to use for the username and password to access MySQL on your hosted server, and use that. If you haven't set up the database yet, that's obviously a problem. No one should have to tell you that it's not going to work if the database isn't set up.

Link to comment
Share on other sites

Don't worry about it. Figure out what you're supposed to use for the username and password to access MySQL on your hosted server, and use that. If you haven't set up the database yet, that's obviously a problem. No one should have to tell you that it's not going to work if the database isn't set up.
A ´famous´ problem! How do I figure out what my username and password are (conf.inc. ?)? Where?
Link to comment
Share on other sites

How can I transfer the table ´links´ from my phpmyadmin of my local host to my db of phpmyadmin of my host (I already have the database!)?

Link to comment
Share on other sites

A ´famous´ problem! How do I figure out what my username and password are (conf.inc. ?)? Where?
They are usually in the control panel for your hosting account. If you don't know where to find them, then ask your hosting company or check on their website for help.
How can I transfer the table ´links´ from my phpmyadmin of my local host to my db of phpmyadmin of my host (I already have the database!)?
On your local server, use phpMyAdmin to export the tables using the SQL format. On your hosting account phpMyAdmin, click on the SQL tab and upload the SQL file that was exported.
Link to comment
Share on other sites

Guest So Called
This I don´t understand! What are include files?
Questions like this Eduard are why we don't like helping you. Every single damned time you have a question you always post it in the forum instead of even trying to read online and find the answers without help. Did it ever occur to you to use Google to discover your answer? Try these by typing them into your Google search box: "What are PHP include files?""PHP include file example""PHP include file tutorial" Read up on that stuff rather than asking forum members to hand feed the information to you. You are never going to get anywhere if you have to get every last part of your knowledge by forum questions and answers. That is why everybody is annoyed with you. We are tired of doing your thinking for you. We are tired of taking the place of you doing a little bit of research. Now as far as the include file itself, you can call it perhaps 'config.php' or 'config.inc.php' or something (the actual name really makes no difference other than ending in php). It could go something like this: config.php
<?php$database_name = "whatever the db name is";$database_user = "user name for same";$database_password = "password";?>

(Actually when I do it I use define('DATABASE_NAME', 'whatever name'); but I don't want to explain what define() is, and setting variables will work. And I use require_once() instead of include ' '.) Then in your file that needs database access you have a statement include 'config.php';. You have two config.php files, one for the shared hosting site, a different one for your local host. You can keep them in different folders on your local PC and then copy the local host one into your USB thing, and FTP the shared hosting version to your account in the cloud. As far as creating the database, and I'm assuming your shared hosting is the same as mine, you'll have to use your cPanel to create a database. During that process you will be assigned database name, etc., probably be assigned a database server (which you will also have to include in your config include file) and either be assigned a password or allowed to create one. Then you can use cPanel to get access to your host's phpMyAdmin, and use that to create tables, etc. As far as importing files, that is just not going to happen. At the rate you're going it will take 10 years to explain it to you. The best you can hope for at present is being able to save your database that you create online, and maybe be able to restore that. At the rate you're going you're going to totally annoy every forum member willing to help you until finally you'll post questions on the forum and you won't get any replies. Google is your friend. Learn to ask Google questions, learn to read manuals and tutorials. For help on any function type this into Google: "php function manual" where you type the name of the function rather than the word itself. For additional help: "php function tutorial" and "php function example" Please quit asking questions when even the rankest beginner could type the same question into Google and get the answer directly.

Link to comment
Share on other sites

Guest So Called

Well then, we are left with (1) you can't understand forum members' replies and you get mad at them, (2) you can't understand any of the Google results, and (3) you won't read the W3Schools tutorials, examples and explanations.

Link to comment
Share on other sites

Well then, we are left with (1) you can't understand forum members' replies and you get mad at them, (2) you can't understand any of the Google results, and (3) you won't read the W3Schools tutorials, examples and explanations.
YOUR opinion (1 until 3 (very) wrong!)!
Link to comment
Share on other sites

I would like to continu where I ended yesterday: My insert.php doesn´t go into my datsbase (on-line!)!Via de Cpanel I also entered in phpmyadmin! There´s a database of last year. I created a new database (website) and a table (links) I now need the username and the password! How do I find the conf.inc.php file? And what´s the advantage of the php script is in the index.php?

Link to comment
Share on other sites

Questions like this Eduard are why we don't like helping you. Every single damned time you have a question you always post it in the forum instead of even trying to read online and find the answers without help. Did it ever occur to you to use Google to discover your answer? Try these by typing them into your Google search box: "What are PHP include files?""PHP include file example""PHP include file tutorial" Read up on that stuff rather than asking forum members to hand feed the information to you. You are never going to get anywhere if you have to get every last part of your knowledge by forum questions and answers. That is why everybody is annoyed with you. We are tired of doing your thinking for you. We are tired of taking the place of you doing a little bit of research. Now as far as the include file itself, you can call it perhaps 'config.php' or 'config.inc.php' or something (the actual name really makes no difference other than ending in php). It could go something like this: config.php
<?php$database_name = "whatever the db name is";$database_user = "user name for same";$database_password = "password";?>

(Actually when I do it I use define('DATABASE_NAME', 'whatever name'); but I don't want to explain what define() is, and setting variables will work. And I use require_once() instead of include ' '.) Then in your file that needs database access you have a statement include 'config.php';. You have two config.php files, one for the shared hosting site, a different one for your local host. You can keep them in different folders on your local PC and then copy the local host one into your USB thing, and FTP the shared hosting version to your account in the cloud. As far as creating the database, and I'm assuming your shared hosting is the same as mine, you'll have to use your cPanel to create a database. During that process you will be assigned database name, etc., probably be assigned a database server (which you will also have to include in your config include file) and either be assigned a password or allowed to create one. Then you can use cPanel to get access to your host's phpMyAdmin, and use that to create tables, etc. As far as importing files, that is just not going to happen. At the rate you're going it will take 10 years to explain it to you. The best you can hope for at present is being able to save your database that you create online, and maybe be able to restore that. At the rate you're going you're going to totally annoy every forum member willing to help you until finally you'll post questions on the forum and you won't get any replies. Google is your friend. Learn to ask Google questions, learn to read manuals and tutorials. For help on any function type this into Google: "php function manual" where you type the name of the function rather than the word itself. For additional help: "php function tutorial" and "php function example" Please quit asking questions when even the rankest beginner could type the same question into Google and get the answer directly.

I did (Google) (a long time ago!). But as I wrote several times the php.manual is NOT written for beginners!
Link to comment
Share on other sites

Guest So Called

wow

You would rather simply ask a question on a forum versus looking at the resources you have been given in the first place. Seriously, that is a painfully easy question to answer given the resources we have given to you or even simply doing a Google search
wow**2
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...