!!!!! Posted February 3, 2007 Share Posted February 3, 2007 Okay, yes I know this is a newbie question but I have looked in a TON of different places to find the answer to my question but I just cannot find it! Question: What does all this mean? (I think I know what the Field thing is, the name of the field, the name that pops up when somebody searches the Table.) Please try to tell me what it all means in simple terms :-P Thanks! Quote Link to comment Share on other sites More sharing options...
!!!!! Posted February 3, 2007 Author Share Posted February 3, 2007 Okay, yes I know this is a newbie question but I have looked in a TON of different places to find the answer to my question but I just cannot find it! Question: What does all this mean? (I think I know what the Field thing is, the name of the field, the name that pops up when somebody searches the Table.) Please try to tell me what it all means in simple terms :-P Thanks! Anyone? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted February 3, 2007 Share Posted February 3, 2007 <a href="http://www.reg.ca/faq/PhpMyAdminTutorial.html">Tutorial</a> Quote Link to comment Share on other sites More sharing options...
!!!!! Posted February 3, 2007 Author Share Posted February 3, 2007 <a href="http://www.reg.ca/faq/PhpMyAdminTutorial.html">Tutorial</a> I tried that Tutorial and it didn't work. I tried the little Test thingy it tells you to try and all I got was: Error SQL query: CREATE TABLE `People` ( `id` INT( 6 ) NOT NULL DEFAULT '0' AUTO_INCREMENT PRIMARY KEY , `name` CHAR( 100 ) NOT NULL , `telephone` CHAR( 50 ) NOT NULL , `birthday` CHAR( 50 ) NOT NULL , PRIMARY KEY ( `name` , `telephone` ) ) TYPE = MYISAM MySQL said: #1068 - Multiple primary key defined Quote Link to comment Share on other sites More sharing options...
only one Posted February 3, 2007 Share Posted February 3, 2007 everyone starts from somewhere.... first you want to make a field just call you first field "field" or something type a number into the Length/Values* textfield id recommend 255 for now, this lets you only use up to 255 characters or numbers in your field wen you put something inside it "dont touch anything else yet", you can now create you table. now that you have created a table with a field in it look along the top for a tab saying "insert" type something into the textbox and click "go", this will insert a row into your table inside the database there are alot of things fields can do, first of all the different types, "varchar" lets any characters and numbers including <>!"£$%^&*(){}[]#/\| can be inserted into the field "tinyint" just means, a few numbers "text" lets you use as much of anything that you want, if you use text you dont need any lengths or values youll get to know the rest as you use them dont ask me what attributes are for because i never use them myself NULL just means weather the feild is left blank or if it has a deafault (put it on "NOT NULL" it doesnt really make a difference) the "Default**" just means that everytime theres a new row made that feild automatically gets the thing you want put into it automatically the Extra usually uses an auto_increasement function, this can only be enabled if that feild is the primary key (note: there can only be one primary key) if you put it one auto_increasement id advise you to put the feild type on int, this only allows numbers to be used in the feild, the auto increasement function lets makes the every new row automatically get +1, eg: if you use an id for something like a user id, everyone that registers will automatically get a new id, thats most of the basics hope you understand, if you dont mail me Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted February 3, 2007 Share Posted February 3, 2007 Error SQL query: CREATE TABLE `People` ( `id` INT( 6 ) NOT NULL DEFAULT '0' AUTO_INCREMENT PRIMARY KEY , `name` CHAR( 100 ) NOT NULL , `telephone` CHAR( 50 ) NOT NULL , `birthday` CHAR( 50 ) NOT NULL , PRIMARY KEY ( `name` , `telephone` ) ) TYPE = MYISAM MySQL said: #1068 - Multiple primary key defined That query is nowhere in that tutorial. o.O I suggest you read the MySQL manual, and learn how to form manual queries before you try something like phpMyAdmin. And either way, doesn't this belong in the 3rd party scripts forum? Quote Link to comment Share on other sites More sharing options...
!!!!! Posted February 4, 2007 Author Share Posted February 4, 2007 Okay, I got all my fields working. ^-^ What I'm using this for is for users of my website to be able to search for items from a MMORPG... It's a fansite. 1 More Question. Whenever 1 of the users of my website looks at 1 of my 'fields' or whatever with all the info in it, how do I make the info go into a table with columns and rows? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 4, 2007 Share Posted February 4, 2007 what, like browse the information? display it on a page. i suggest you search for some tutorials for retrieving mysql data. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted February 4, 2007 Share Posted February 4, 2007 ok apart from the actual code ( use a tutorial ) it would look something like this $SQL = SELECT field1, 2, 3, 4, ,5 FROM TABLE 1 $QUERY = mysql_query($CONNECTION VARIABLE, $SQL) mysqli_fetch_array($QUERY) this array contains all the info from the database query ie the first request to display all the entries it would look something like while($row = mysql_fetch_array($QUERY)) { ## ignore the previous fetch array if using ths loop, you only need it once echo $row['field1'] echp $row['4'] etc you put the infprmation into HTML tables if you want a table BUT THIS SHOULD ALL BE IN A TUTORIAL SOMEWHERE. but i recommend google "php, mysql querys " or something like that good luck Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 4, 2007 Share Posted February 4, 2007 PC Nerd. why did you mysqli_fetch_array near the top, this is mysql. and you dont need to list the seperate fields, just use the * $SQL = "SELECT * FROM table"; $QUERY = mysql_query($SQL) or die("Error: ".mysql_error()); Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted February 4, 2007 Share Posted February 4, 2007 but that selects all, if you want certain fields you have to list them. anyway it was just a quick thing and i didnt think much, ppl should look 4 tutorials on mysql querys and stuff like that. theres plenty around Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 4, 2007 Share Posted February 4, 2007 yeah i no what you mean. i am just saying, it may take a tad longer, probably not even but its quicker to write select * then to write out all the fields you want to select. lol. but i guess thats just my personal opinion. Quote Link to comment Share on other sites More sharing options...
only one Posted February 4, 2007 Share Posted February 4, 2007 http://time-2-design.com/tutorials.php?type=php all youll ever want to know Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.