jscix Posted February 9, 2007 Share Posted February 9, 2007 Okay, first off i'm a noob, (Also I hope this is the right forum for this.) I just started learning php 18 hours ago.. so yeah, laugh it up if nessecary, but someone point me in the right direction please. I am reading: Learning PHP and MySQL By Michele Davis, Jon Phillips I Just got to the SQL Databases chapter. The problem is... I am using a remote web server to practice PHP. I did not install SQL/PHP on my machine, and I would rather not. Ok, Here is what I am trying to do. ---> Chapter Reference: ---------------------------------------------------- 7.2.1. Creating Tables Use the create table command to specify the structure of new database tables. When you create a database table, each column has a few options, in addition to the column names and data types. Values that must be supplied when adding data to a table use the NOT NULL keyword. The PRIMARY KEY keyword tells MySQL which column to use as a key field. Then, you have MySQL automatically assign key values by using the AUTO_INCREMENT keyword. To create these tables, paste the code into the MySQL command-line client. Example 7-1 creates the books table using the data types from Table 7-8. Example 7-1. CREATE TABLE books ( title_id INT NOT NULL AUTO_INCREMENT, title VARCHAR (150), pages INT, PRIMARY KEY (title_id)); CREATE TABLE authors ( author_id INT NOT NULL AUTO_INCREMENT, title_id INT NOT NULL, author VARCHAR (125), PRIMARY KEY (author_id)); ---------------------------------------------------- Now since I am using a remote web server to practice, how would I go about creating a table in SQL? My web server has PHP/SQL, so.. I would assume there is a "MySQL command-line client" of some kind that I can use? If so: How do I access/use it? Sorry if im asking the wrong questions/whatever. someone help me out? ty. Quote Link to comment Share on other sites More sharing options...
fert Posted February 9, 2007 Share Posted February 9, 2007 just do it in php or you might have phpmyadmin Quote Link to comment Share on other sites More sharing options...
jscix Posted February 9, 2007 Author Share Posted February 9, 2007 Unfourtantly this book only teaches you how to create tables from the MySQL command-line client. It has no information on doing it with PHP. Could you possibly link me to a Guide/Reference/How-To? Quote Link to comment Share on other sites More sharing options...
fert Posted February 9, 2007 Share Posted February 9, 2007 http://us2.php.net/manual/en/function.mysql-connect.php http://us2.php.net/manual/en/function.mysql-query.php Quote Link to comment Share on other sites More sharing options...
jscix Posted February 9, 2007 Author Share Posted February 9, 2007 Tyvm! cheers 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.