I'm a noob, and I need help

Could you also give me some code to create the table? I don’t think I created it correctly

http://sql-info.de/mysql/examples/CREATE-TABLE-examples.html

yes thankyou but I want to make sure they are they right type so if you could give me some mysql code or php thankyou very much

I know your not asking for free code again… the site gives you examples of the mysql code and how to create tables using it. Your port field should be integers probably of 10 or so. Your server field should be varchar of about 40 or maybe 100 depending on server address lengths and if they include letters and numbers or just numbers. Your plugin version appears to be a number so use the integer option again. You should also include an id row so you can identify the rows in the database, this row should be auto incremented. Here is another site with an example http://www.tizag.com/mysqlTutorial/mysqltables.php

Ok how would I make the id part of the script?

You should not need to make it part of the script unless your planning on having the script create a table on several databases or your distributing the script…

If that is the intent then you need to query the database for the table name and if the result is NULL or Empty or 0 (depending on your query type) you have the script create the table. If the table exists then continue on with injecting the data. You write a query line like you did before with the Select and Updates lines you just us the CREATE sql commands from those examples.

here is a simple example of checking that a table exists in a database.

no how do I do the auto increment for id?

Both of the example pages I posted have auto increment in a section or in use. Seriously you need to do some of the work here. Google is a very good tool for answering these questions, please use it.

Sponsor our Newsletter | Privacy Policy | Terms of Service