PDA

Click to See Complete Forum and Search --> : SQL command


Tnen
Jan 23rd, 2003, 06:39 AM
hi

i have an SQL file i attached with the message
how can i make a php file that add that SQL commands to a db

dbhost = "localhost"
dbname="tnen"
dbuser="t"
dbpass="t"

can you make the php file for me please

phpman
Jan 23rd, 2003, 09:03 AM
wel without looking at the file I will suggest you read teh mysql manual and the php manual and do it yourself, or at least try.

to insert

"INSERT into Table (id,name,email) values('',$name,$email) "

to select

"SELECT * form table"

to update

"UPDATE table set name=$name, email=$eamil where id=$id"


understand? you won't find anybody to do it for you but we are very willing tohelp you.

Tnen
Jan 24th, 2003, 03:28 AM
if you looked at the file you will see a lot of lines of sql commands
so if i want to make them like you say i think i will never finish

is there any way that i can add in the php code the name of the file (sql file) and the code do those commands

phpman
Jan 24th, 2003, 07:50 AM
install a program called phpMyAdmin and you can upload that file into that program and it will do it for you. the program works off the web so it will be easy. it is located here http://www.phpmyadmin.net/

Tnen
Jan 24th, 2003, 12:01 PM
look i have phpmyadmin but i want to make a special php file

phpman
Jan 24th, 2003, 12:23 PM
look, why re-invent the wheel. :confused:

it won't be so special if all you have to do is connect to the db and then use mysql_query on all those creates and inserts, that is all. And you would have even found that out fi you would have read the mysql or php manual......

Tnen
Jan 24th, 2003, 03:29 PM
Look phpman i have no time to read php manual or other
and i am asking for a help here
can any one help me

phpman
Jan 24th, 2003, 03:53 PM
no I guess not, you would just rather waste a day or more arguing it on here :rolleyes: . now that took me a whole 10 minutes with find/replace and added what I told you in one of my posts.

now change you db info at the top and should be good to go
rename to .php istead of .txt

The Hobo
Jan 24th, 2003, 06:39 PM
Originally posted by Tnen
Look phpman i have no time to read php manual or other
and i am asking for a help here
can any one help me

Give me a car and a house. I don't have time to work and earn money. Just give it to me. :rolleyes:

That's not how the world works, chap.

phpman
Jan 30th, 2003, 11:39 AM
and see, you help the guy out and what do you get....NOTHING.

and you wonder why people don't write code for anybody, you have to learn it.

don't expect to get any more help from us, or me at least, in the future....:mad: