INSERT INTO database
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 [sql]CREATE TABLE table ( naam VARCHAR(35) NOT NULL, email VARCHAR(50) NOT NULL, titel VARCHAR(30) NOT NULL, info TEXT NOT NULL );[/sql] 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. PHP Code:
PHP Code:
If: Add Do: Connect Database, Add content of form to database Just a notice: Naam: Code:
<input type="text" name="naam" size="20" maxlength="20"> Is doesn't mather how your form is called, only that everything is put in the right table. PHP Code:
I hope you know now a bit of the working of mySQL;) Good Luck |
<a href="https://vborg.vbsupport.ru/showthread.php?s=&postid=390345#post390345" target="_blank">Click here for SELECT FROM database tutorial</a>
|
Could you write a tutorial about "How to Update Database" ?
|
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? |
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 |
Quote:
No, you don't need to use a user/password to connect to the database. |
Also this article shouldn't be in the vb section because it isn't using vb methods
|
All times are GMT. The time now is 11:40 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|