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

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

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

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








Modifying Stored Data

Having entered your data into a database table, you might like to change
it. Whether you want to correct a spelling mistake, or change the date attached
to a joke, such alterations are made using the UPDATE command. This command contains
elements of the INSERT command (that set column values)
and of the SELECT command (that pick out entries to modify).
The general form of the UPDATE command is as follows:


mysql>UPDATE table_name SET
-> col_name = new_value, ...
->WHERE conditions;

So, for example, if we wanted to change the date on the joke we entered
above, we'd use the following command:


mysql>UPDATE Jokes SET JokeDate="1990-04-01" WHERE ID=1;

Here's where that ID column comes in handy. It allows
us to easily single out a joke for changes. The WHERE clause here works just like it does in the SELECT command.
This next command, for example, changes the date of all entries that contain
the word "chicken":


mysql>UPDATE Jokes SET JokeDate="1990-04-01"
->WHERE JokeText LIKE "%chicken%";

/ 190