Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
INSERT INTO database
flup
Join Date: Jan 2002
Posts: 872

Maastricht, NL
by flup flup is offline 02 May 2003

In this tuturial a lot of mySQL and PHP will become clear to you.
This tutorial was posted on www.webmeesteres.nl and is very good for the novice (like me, i started yesterday with it, and im now getting the clue of mySQL and PHP together)

___________________________________________________

Start:
In this articel, i'll explain how to add text into a database.
The articel is wroten for newbies, and I think you know how to create a table in a database, though, i'm still explaining that part a bit.

The Tutorial:
To put text in a database, first of al you need a database and a tabel, we assume you already have a database, so you have to create your tabel


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


This table is called: table (woow, how did i get this ;P)
And the fields are called: naam, email, title, info (dutch)

Naam is a regular field to enter your name and may contain various characters (varchar) with 35 chars (35)
For email and titel is the same, but with info, it could be anything, this has been marked with TEXT, text hasn't got any preset length.
This code is easy to add in a database, just copy and paste the code in PHPmyAdmin

ok, second, we are going to make a form wich is called insertcode.php but that could be anything.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Ok, now you've got your table we are heading to the next part of this tutorial, because, with only a form you cant add anything.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To explain this part, we've to talk a bit weird, but that explains best:

If: Add
Do: Connect Database, Add content of form to database


Just a notice:

Naam:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

In this piece of code, it says the name of naam is naam. The content of naam will be put in the table naam.
Is doesn't mather how your form is called, only that everything is put in the right table.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

In this code, it makes a mysql_query, called $insert, if it can't doe this query it will report an error.

I hope you know now a bit of the working of mySQL
Good Luck

Last edited by Xenon; 02 May 2003 at 10:59..
Views: 5748
Reply With Quote
Comments
  #2  
Old 02 May 2003, 11:02
flup's Avatar
flup flup is offline
 
Join Date: Jan 2002
Real name: Joshua
Click here for SELECT FROM database tutorial
Reply With Quote
  #3  
Old 04 Jun 2006, 09:40
vietkieu_cz vietkieu_cz is offline
 
Join Date: Dec 2005
Could you write a tutorial about "How to Update Database" ?

Last edited by vietkieu_cz; 04 Jun 2006 at 10:32.
Reply With Quote
  #4  
Old 13 Jun 2006, 02:16
Bubble #5 Bubble #5 is offline
 
Join Date: Apr 2005
Question

Joshua good stuff

Is there anyway to display the new table data that you've made in a post on the forum? For example; someone sends the data to the table and the forum then creates a new post and displays it. Each time someone sends this data to the table the forum posts a new post. How hard would it be to do this?
__________________
If we don't help each other when we can, then we're not making this world a better place.
Reply With Quote
  #5  
Old 12 Aug 2009, 14:39
Come2Daddy Come2Daddy is offline
 
Join Date: May 2008
Do we have to use the user and password to connect to the database
this is not vbulletin style of connecting to database
I've seen lots of hacks don't use the user and password

otherwise how could they publish it to share it with others boards
Reply With Quote
  #6  
Old 12 Aug 2009, 15:56
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Come2Daddy View Post
Do we have to use the user and password to connect to the database
this is not vbulletin style of connecting to database
I've seen lots of hacks don't use the user and password

otherwise how could they publish it to share it with others boards
This article if from 2003.

No, you don't need to use a user/password to connect to the database.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #7  
Old 13 Aug 2009, 09:49
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Also this article shouldn't be in the vb section because it isn't using vb methods
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 01:28.

Layout Options | Width: Wide Color: