|
To edit
The information edition in mysql, it combines options to Insert information to MySQL and of Consultations MySQL, we will have to do a consultation how the following one:
UPDATE table SET stood out = 'value' WHERE condition
Since you see, we use the clause WHERE again for escojer the earnings that it is necessary to edit, can update several fields of the following way:
UPDATE table SET stood out = 'value', campo2 = 'valor2' WHERE condition
The method does not have more secret than this, let's see a real example to see how it works exactly from PHP:
<? php
$sql = "UPDATE agenda SET phone = 555405181 WHERE names = 'eloi'";
mysql_query ($sql, $db);
?>
To remember that $db it contains an identifier of the connection.
To erase
To erase the certain some of a MySQL table is even simpler that to edit them, since it is only nescesario to indicate that we want to erase earnings with a clause WHERE and in that we it will do table, and this together with the word DELETE FROM they will give us the result for that we wait:
DELETE FROM table WHERE condition
I do not believe that it is nescesario to put the example of this case, if ahún so doubts go out to consult in the forum.
Author: Eloi of St Martin.
www.programacionweb.net |