Settings and mysql database creation



I want someone to tell me how to add database details and create tables for following script

if you go to class folder, it has class.database.php and settings.php. I have put database info in both files. Dont know right or wrong. My website is you can see error. I do not know how to create tables for this script. Need help.


i picked one of the files from class, it contains for example this line:

$sSQL = "INSERT INTO artist (name, website,location,twitter,user_id) VALUES ('$this->name', '$this->website', '$this->location','$this->twitter',$this->user_id );";

which means in either php or mysql (or whatever database you have) you need to create all the tables, i can't see any php files which he seems to have used to create the tables, so could be he done that directly in sql, then it is really hard for you to reconstruct


I have sql files from two different scripts which you can download from

1. B2B sql queries: and /data.txt
2. Freelance site sql:

My questions

  1. The script I provided you earlier is an ecommerce. Is it possible to use any of these sql queries to create tables for that ecommerce script? How?

  2. If yes, I am not able to understand what changes do i have to make to use any of the queries for my script and to make it compatible with my site?


Yes, it is. But you need a sql connect query in the beginning of the file (i don't see it, which makes sense, so you need to add it), then simple visit the php page which contains the sql query's, and you should be good (you can check in the sql console)


Thank you. As you said earlier, there is no such php file. I haven't done such thing before, so have no idea at all.

  1. What if I goto phpmyadmin > SQL > paste these queries and run?

  2. In which files of the website script, I have to put the database details and most importantly where within that particular file. Can you mention the line numbers which I should edit to put my database details?

  3. Another confusion is, Do I need to make any changes to the query as it is for a different website?


i am confused, let me get one thing straight. this: and the other text file are query's to create the tables inside your database. Then you need another set of query's to retrieve data and store data in to the databases

If you haven't done such a thing before, isn't it a better idea to write your own query's to create the tables? and then your own query's to retrieve and store data in a database, and start with something small, rather then something so massive?


ok :worried: for now, i only want to create tables.


you can use phpmyadmin for that, and then sql, you can write your own query's, start with someting simple like:
create table tablename(



obviously replace table name with the name you want your table to have. You do know what int and varchar are right?


ok thank you for your time


you are right :wink:


Then once you got this, make a second table, use a foreign key, learn about this, and joints etcetera, then expand it, by starting with making a design


just tell me one last thing. In which file or files I should put my database details? and also tell me the line number in the files to edit. for example class.database.php and line number x to y.

By details I mean host, database name, database username and password


write your own php files, don't use those, they are out of your leageau