Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
How To Update Existing Rows in a Table
How To Update Existing Rows in a Table? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts
✍: FYIcenter.com
Updating existing rows in a table requires to run the UPDATE statement with a WHERE clause to identify the row. The following sample script updates one row with two new values:
<?php include "mysql_connection.php"; $sql = "UPDATE fyi_links SET notes='Nice site.', counts=8" . " WHERE id = 102"; if (mysql_query($sql, $con)) { print(mysql_affected_rows() . " rows updated.\n"); } else { print("SQL statement failed.\n"); } mysql_close($con); ?>
If you run this script, you will get something like this:
1 rows updated.
2007-05-11, 5390👍, 0💬
Popular Posts:
What Is Posting? Posting is an event that writes Inserts, Updates and Deletes in the forms to the da...
What Happens If a Hyper Link Points to a Music File? - XHTML 1.0 Tutorials - Understanding Hyper Lin...
Can you explain in GSC and VAF in function points? In GSC (General System Characteristic) there are ...
How do you target a specific frame from a hyperlink? Include the name of the frame in the target att...
Is There Any XSD File to Validate Atom Feed Files? - RSS FAQs - Atom Feed Introduction and File Gene...