MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old June 10th, 2000, 12:44 PM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I am looking for a good in-depth tutorial on something which I seem to not be grasping... or maybe I'm over 'grasping'...

I've read quite a few docs, books and tutorials on PHP and MySQL. I think I have the basic stuff down, but one thing still
escapes me.

After all the talk of normalization, and breaking databases into multiple tables to simply updates, I find myself with questions.

What I am looking for is something which covers storing data from a web form, into a
database which has multiple tables, preferably a tutorial on using PHP and MySQL.

I found one not too long ago, but the thing was on Access and ASP. And didn't really seem to have much to offer.

In my mind I can see how it would work with something a persons "state" whereby the table for state could be completely defined... therefore inserting the "id" for the state in the primary table would be of no consequence.

But where I am getting all sorts of dorked is on those tables which would have to populated
from the given form..

Let's say for argument sake, "cities" or "zip/ccodes"

So.. anyway, a tutorial on this would be quite helpful, I'm sure that once I figure that part out, I'll be flying right forward.

------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
  #2  
Old June 10th, 2000, 03:20 PM
murdy murdy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 4 murdy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The first book on PHP that I bought was PHP Essentials and the next book was the newriders MySQL book, and just last week I bought the Professional PHP Programming book.

The PHP Essentials by Julie Meloni has a lot of examples and tutorials on using web based forms to populate tables in databases.

It walks you through using web forms to create tables in your DB, through using web forms to add, modify, or even delete info from your tables that are already there.

I am a total moron, never did much except install CGI scripts on my server, yet I have been able to use that book along with the MySQL book to create a pretty intricate web based database control using forms.

I think they have some tutorials on their website at www.thickbook.com.

Reply With Quote
  #3  
Old June 10th, 2000, 04:39 PM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Thanks, I will check into this.

I only wish that Web Monkey would have had
a little more in-depth Tutorial on this subject, instead theirs used ASP and Access.




------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
  #4  
Old June 11th, 2000, 01:46 AM
murdy murdy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 4 murdy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Basically,

The key is just populating your forms with variables that will be passed into your database through the {INSERT INTO} statement

i.e.
(form method="POST" action="variables.php3")
(input type="text" name="variable1" size=20)
(input type="text" name="variable2" size=20)
(input type="submit" value="Submit Form")
(/form)

Then just pass variable1 and variable2 into an INSERT INTO statement by using the variables.php3 script. (the script that you call with the action statement in your form.)

//variables.php3 script

(?
$sql = insert into table_name (field_1, field2) VALUES ($variable1, $variable2)

//use your connection info here or call it from an include

$connection = mysql_connect("host_name", "username", "password")

$db = mysql_select_db("db_name", $connection)

//then execute your query

$sql_result = mysql_query($sql, $connection)

?)

You can then use different versions of the same program to query the database and make modifications or deletions in your tables. You just call on those same variables and resubmit them in forms that use different MySQL statements. (i.e. instead of INSERT INTO, you would use DELETE to delete rows from your table or UPDATE to modify rows or fields in your table.

[This message has been edited by murdy (edited June 11, 2000).]

Reply With Quote
  #5  
Old June 11th, 2000, 02:19 AM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Murdy,

Let me see if I understand this right.

We say the variable1 goes into a table called
variable1, and variable2 is to be inserted into a table named variable2.

In order to get them there, and "link" them with an id, (as used for association in Normalization).

We run two separate insert statements, then we querry and update the data in table (variable1) with the appropriate ID for the item in table (variable2)?

I guess what I'm getting at is I am inserting
into a normalized database, which has multiple tables, a primary table and then other tables.

We naturally have to have an ID for each row of each table, the main table will contain an id used in the joining of the data for later
review or whatever purpose.

Now, as I look at your example, it looks like all the other standard "one table" insert methods.

I guess what I really don't understand is why we can list elements in a joined fashion, but are unable to insert/delete/update data in a similar fashion..

------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
  #6  
Old June 14th, 2000, 02:10 PM
Robman Robman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47 Robman User rank is Private First Class (20 - 50 Reputation Level)Robman User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
This might be a little late but Webmonkey does have a tutorial. Check it out here: http://hotwired.lycos.com/webmonkey...ml?tw=frontdoor

I used this extensively when I first started using PHP and MySQL. Definitely helped me get off the ground.

Robman

Reply With Quote
  #7  
Old June 14th, 2000, 02:27 PM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Robman:
This might be a little late but Webmonkey does have a tutorial. Check it out here: http://hotwired.lycos.com/webmonkey/99/21/index2a.html?tw=frontdoor

I used this extensively when I first started using PHP and MySQL. Definitely helped me get off the ground.

Robman
[/quote]

Robman,

Thanks for the input, however I have solved the problem I was having, just making this a bit more difficult than they were.
I agree with you on WebMonkey's tutorials, they have all been very good, and I have read them, as well as have a printed copy of them.
I was a bit surprised by their ommission of using a database for encryption, in their encryption tutorial, of course I solved that one on my own..

Anyway, thanks for the input, I appreciate all the help that everyone has had to offer.

------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Looking for Good Tutorial


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway