<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=AppInventor%3A_Put_Data_ke_MySQL</id>
	<title>AppInventor: Put Data ke MySQL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=AppInventor%3A_Put_Data_ke_MySQL"/>
	<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=AppInventor:_Put_Data_ke_MySQL&amp;action=history"/>
	<updated>2026-05-07T22:15:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>https://onnocenter.or.id/wiki/index.php?title=AppInventor:_Put_Data_ke_MySQL&amp;diff=70005&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot;To update (PUT) data in a MySQL server from an App Inventor 2 app, you also need to use a web service (typically a server-side script) as an intermediary. The server-side scri...&quot;</title>
		<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=AppInventor:_Put_Data_ke_MySQL&amp;diff=70005&amp;oldid=prev"/>
		<updated>2024-01-14T12:03:19Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;To update (PUT) data in a MySQL server from an App Inventor 2 app, you also need to use a web service (typically a server-side script) as an intermediary. The server-side scri...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;To update (PUT) data in a MySQL server from an App Inventor 2 app, you also need to use a web service (typically a server-side script) as an intermediary. The server-side script will handle the update operation and communicate with your App Inventor app. Here's a simple example using PHP as the server-side script:&lt;br /&gt;
&lt;br /&gt;
Create a PHP script on your server:&lt;br /&gt;
&lt;br /&gt;
Save the following PHP script as put_data.php on your server:&lt;br /&gt;
&lt;br /&gt;
php&lt;br /&gt;
Copy code&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Retrieve data from the POST request&lt;br /&gt;
$id = $_POST['id'];&lt;br /&gt;
$newName = $_POST['newName'];&lt;br /&gt;
$newEmail = $_POST['newEmail'];&lt;br /&gt;
&lt;br /&gt;
// Database connection parameters&lt;br /&gt;
$servername = &amp;quot;your_mysql_server&amp;quot;;&lt;br /&gt;
$username = &amp;quot;your_mysql_username&amp;quot;;&lt;br /&gt;
$password = &amp;quot;your_mysql_password&amp;quot;;&lt;br /&gt;
$dbname = &amp;quot;your_database_name&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Create connection&lt;br /&gt;
$conn = new mysqli($servername, $username, $password, $dbname);&lt;br /&gt;
&lt;br /&gt;
// Check connection&lt;br /&gt;
if ($conn-&amp;gt;connect_error) {&lt;br /&gt;
    die(&amp;quot;Connection failed: &amp;quot; . $conn-&amp;gt;connect_error);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update data in the database&lt;br /&gt;
$sql = &amp;quot;UPDATE your_table_name SET name='$newName', email='$newEmail' WHERE id=$id&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
if ($conn-&amp;gt;query($sql) === TRUE) {&lt;br /&gt;
    echo &amp;quot;Data updated successfully&amp;quot;;&lt;br /&gt;
} else {&lt;br /&gt;
    echo &amp;quot;Error: &amp;quot; . $sql . &amp;quot;&amp;lt;br&amp;gt;&amp;quot; . $conn-&amp;gt;error;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$conn-&amp;gt;close();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
Replace placeholders like your_mysql_server, your_mysql_username, your_mysql_password, your_database_name, and your_table_name with your actual MySQL server details.&lt;br /&gt;
&lt;br /&gt;
App Inventor Components:&lt;br /&gt;
&lt;br /&gt;
In your App Inventor project, you'll need to use the Web component to send HTTP POST requests. Additionally, use TextBox components or similar to allow users to input data.&lt;br /&gt;
&lt;br /&gt;
App Inventor Blocks:&lt;br /&gt;
&lt;br /&gt;
Here's a basic set of blocks to send a PUT request with data:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Adjust the URL to point to your deployed PHP script.&lt;br /&gt;
&lt;br /&gt;
Testing:&lt;br /&gt;
&lt;br /&gt;
Test your app by entering data in the text boxes, providing the ID of the record to update, and clicking the &amp;quot;Update&amp;quot; button. Check your MySQL database to see if the data has been successfully updated.&lt;br /&gt;
&lt;br /&gt;
As with the previous examples, remember to implement appropriate error handling, data validation, and security measures in a real-world scenario. Also, consider using HTTPS for secure data transmission.&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>