PDA

View Full Version : uploading php file with mysql


Aymen++
04-11-2003, 08:40 PM
i wrote a code in php that connect to mysql database in my computer and every thing is ok, but i want to upload these files to the internet, how can i do that? i mean in which directory should i put these files?
for more illustration, the directory that my files in is c:\apache\... and the database is in c:\apache\mysql\data\mydatabase (the name of the database is "mydatabase").

missing-score
04-11-2003, 08:52 PM
No worrys, the connection should automatically connect to the database.

So say my www root is C:\phpdev5\www and my databases are in C:\phpdev5\mysql. If I then decide to move a file from say C:\phpdev5\www\index.php to C:\phpdev5\www\newfolder\index.php, I do not have to change my code, because it will still connect to the database.

If you have doubts, post your database connection code.

Aymen++
04-11-2003, 10:47 PM
ok, if i change the directory of the database?
i mean in which folder should i put it (the data base) when i want to appload it?

missing-score
04-11-2003, 10:50 PM
Oh right, you want to upload a database aswell. I didn't realise.

You will need to put the db in the mysql root folder ( the folder from which mysql runs ) there is a folder for the databases.

Hope this helps... :thumbsup:

Aymen++
04-11-2003, 11:03 PM
how can i find this directory?

missing-score
04-12-2003, 12:30 AM
If it is not on your server, the chances are it will not be accessable. Could you just not re-create the tables in the database online?

If not, you may have to e-mail your host and ask them to do it for you.

Aymen++
04-12-2003, 03:27 PM
in order to be more clear, i wrote a registration form that prompt you to enter your id and your details, but now i want to upload it to lycos.com in order to try it there, i didn't understand these words:
If it is not on your server, the chances are it will not be accessable. Could you just not re-create the tables in the database online?
please write to me in easy english because my english is not good :o .

Aymen++
04-12-2003, 03:30 PM
i forgot to tell you that this registration form is connected to a mysql database.

Nightfire
04-12-2003, 03:37 PM
dump all your phpdev database tables into a txt file, go to lycos and upload your txt file into the database (lycos uses phpmyadmin if i remember right)

missing-score
04-12-2003, 06:00 PM
Yes, lycos do use phpMyAdmin Nightfire.

Aymen++
04-13-2003, 03:11 PM
dump all your phpdev database tables into a txt file, go to lycos and upload your txt file into the database (lycos uses phpmyadmin if i remember right)
when i was use asp with access database, when i want to upload an asp page with an access file i know how to do that by uploading them in the same directory, but now how? what is meaning of dump?

raf
04-13-2003, 03:23 PM
PHP relevance?

Anyway, do you use a client or db-fronttool on your machine? I personal use MySQL-front. You have an exportfunction that creates a txt file. in phpMyAdmin, you can browse to this file and run the content of it as a script.

When you create the txt file, you can specify if you wan't to export data, structure or both.

The export (dump) works like this: the client writes the syntax you need to create the exported tables and/or data on another MySQL server. If you run this textfile, the tables are created and the data is inserted.

So you are not copying it, you're (or the db-fronttool) generating a file to recreate the tables in another db.

Chances are you can't create your own db so you'll need to change the db-name in your application.

JVRudnick
04-23-2003, 06:03 PM
Hello all..
I'm still fighting my way thru my first mySQL dbase online -- I'm an ASP guy who's trying to connect to the dbase on my webhost.

Everything *seems* to right, ie I've followed tips here. I can log into the phpmyAdmin webpage okay. I 'dumped' out the data from mySQL table via mySQLFront okay. I imported same using the phpmyAdmin page too. I now see the proper table with all it's data on the page too; it scrolls thru all the records and it looks fine!

'Cept, when my ASP page makes a request via this SQL statement "SELECT * from tblvehicles" I *should* get the whole of the 68 records shown.

Nope. I get an error as below here...
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[TCX][MyODBC]Table 'cars.tblVehicles' doesn't exist

/UsedCars/list.asp, line 114

(which just points at the rs.Open SQL, conn, 2, 3 line)

???? The dbase name is cars; the table is tblvehicles -- so what's that error mean? Also, on my own box here, with the same mySQL dbase etc. the same SQL querie works just fine. And yes, I do have the proper conn string being used with the pointer to the proper server at my webhost being named too...

Anyone here know what I've _@#()*%&_(#*@& missed?

;-)

Jim

JVRudnick
04-23-2003, 07:04 PM
Okay, I see now. I had *inadertantly* left an older 'testing' phrase live with the wrong dbase/tbl info...


So to recap, must I always -- after creating the dbase on my own dev box and testing here to see that it works -- dump the tables into a text file, and import via phpmyAdmin?

Is that the way it "works" on the web with mySQL dbases?

Jim

raf
04-23-2003, 09:56 PM
JVRudnick,

Please post this sort a things in the MySQL forum.

To answer your question. If you need the data you enterd: yes. If you changed the db-design, you also need to modify the db-design on your production db, which can be quite tricky sometimes.

Spookster
04-24-2003, 12:54 AM
This thread does not belong in the PHP forum. I will move it to the MySQL forum.

And JVRudnick, please don't hijack other peoples threads. You should create your own thread for your specific situation.