Build Your Own DatabaseDriven Website Using PHP amp;amp; MySQL [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Build Your Own DatabaseDriven Website Using PHP amp;amp; MySQL [Electronic resources] - نسخه متنی

Kevin Yank

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید








Inserting Data into a Table

Our database is created and our table is built; all that's left is to
put some actual jokes into our database. The command for inserting data into
our database is called, appropriately enough, INSERT. There
are two basic forms of this command:


mysql>INSERT INTO table_name SET
-> columnName1 = value1,
-> columnName2 = value2,
-> ...
->;


mysql>INSERT INTO table_name
-> (columnName1, columnName2, ...)
-> VALUES (value1, value2, ...);

So, to add a joke to our table, we can choose from either of these commands:


mysql>INSERT INTO Jokes SET
->JokeText = "Why did the chicken cross the road? To get to
"> the other side!",
->JokeDate = "2000-04-01";


mysql>INSERT INTO Jokes
->(JokeText, JokeDate) VALUES (
->"Why did the chicken cross the road? To get to the other
"> side!",
->"2000-04-01"
->);

Note that in the second form of the INSERT command,
the order in which you list the columns must match the order in which you
list the values. Otherwise, the order of the columns doesn't matter, as long
as you give values for all required fields. Now that you know how to add entries
to a table, let's see how we can view those entries.

/ 190