<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>view records Archives -</title>
	<atom:link href="https://mitindia.in/tag/view-records/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/view-records/</link>
	<description></description>
	<lastBuildDate>Sat, 26 Nov 2016 06:42:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>view records Archives -</title>
	<link>https://mitindia.in/tag/view-records/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>mysqli-examples</title>
		<link>https://mitindia.in/mysqli-examples/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Sat, 18 Jun 2016 09:00:01 +0000</pubDate>
				<category><![CDATA[PHP-MySQL]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[insert records]]></category>
		<category><![CDATA[phpmysql]]></category>
		<category><![CDATA[update records]]></category>
		<category><![CDATA[view records]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=59</guid>

					<description><![CDATA[<p>Following examples shows that how to use mysqli functions to insert, update, delete and select records from database. mysqli, here the letter &#8216;i&#8217; stands for improved version. Example 1 : Insert record to mysql database through php using MySQLi function. Step 1 : create a following html file. &#60;html&#62; &#60;body&#62; &#60;form name=f1 action="mysqli_ins.php" method="POST"&#62; Enter [&#8230;]</p>
<p>The post <a href="https://mitindia.in/mysqli-examples/">mysqli-examples</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Following examples shows that how to use <b><i>mysqli</i></b> functions to <i>insert, update, delete </i>and<i> select</i> records from database.</p>
<p>mysqli, here the letter &#8216;i&#8217; stands for improved version.</p>
<p>Example 1 : Insert record to mysql database through php using MySQLi function.</p>
<p>Step 1 : create a following html file.</p>
<pre>&lt;html&gt;
&lt;body&gt;
&lt;form name=f1 action="mysqli_ins.php" method="POST"&gt;
Enter Emp Code: &lt;input type=text name=t1&gt; &lt;br&gt;
Enter Emp Name: &lt;input type=text name=t2&gt; &lt;br&gt;
Enter Emp Salary: &lt;input type=text name=t3&gt; &lt;br&gt;
&lt;input type=submit value="Submit Data"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Step 2: Now create &#8220;mysqli_ins.php&#8221; with following code in it.</p>
<pre>&lt;?php

$ec=$_POST['t1'];
$en=$_POST['t2'];
$sal=$_POST['t3'];

$servername = "localhost";
$username = "root";
$password = "";
$dbname = "emp_db";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn-&gt;connect_error) {
    die("Connection issue: " . $conn-&gt;connect_error);
} 

$sql = "INSERT INTO emp_details (ecode, ename, sal)
VALUES ('$ec', '$en', '$sal')";

if ($conn-&gt;query($sql) === TRUE) {
    echo "New record added successfully";
} else {
    echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
}
$conn-&gt;close();
?&gt;</pre>
<p>Step 3: Now run html file and enter a record in it and click on submit button to insert new record to table.</p>
<p>Example 2: Below example shows updating an existing records.</p>
<pre>&lt;?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "emp_db";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn-&gt;connect_error) {
    die("Connection issue: " . $conn-&gt;connect_error);
} 

$sql = "UPDATE emp_details SET ecode='e002' WHERE ename='amit'";

if ($conn-&gt;query($sql) == TRUE) {
    echo "One record updated successfully";
} else {
    echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
}
$conn-&gt;close();
?&gt;</pre>
<p>Example 3: Below example shows that old / existing record can be deleted.</p>
<pre>&lt;?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "emp_db";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn-&gt;connect_error) {
    die("Connection issue: " . $conn-&gt;connect_error);
} 

$sql = "DELETE from emp_details  WHERE ecode='E91'";

if ($conn-&gt;query($sql) === TRUE) {
    echo "One record Deleted successfully";
} else {
    echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
}
$conn-&gt;close();
?&gt;</pre>
<p>Example 4: Select query example.</p>
<pre>&lt;?php
$con=mysqli_connect("localhost","root","","emp_db");

if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$result = mysqli_query($con,"SELECT * FROM emp_details");

echo "&lt;center&gt;";
echo "&lt;h2&gt;Select Query &lt;/h2&gt;";
echo "&lt;table border=1&gt;";
echo "&lt;tr bgcolor=khaki&gt;";
echo "&lt;th&gt; Employee code &lt;/th&gt;";
echo "&lt;th&gt; Employee Name &lt;/th&gt;";
echo "&lt;th&gt; Salary &lt;/th&gt;";
echo "&lt;/tr&gt;";

while($row = mysqli_fetch_array($result))
  {
echo "&lt;tr&gt;";
echo "&lt;td&gt;" .$row['ecode']. "&lt;/td&gt;";
echo "&lt;td&gt;" .$row['ename']. "&lt;/td&gt;";
echo "&lt;td&gt;" .$row['sal']. "&lt;/td&gt;";
}
echo "&lt;/table&gt;";
echo "&lt;center&gt;";
?&gt;</pre>
<p>&nbsp;</p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fmysqli-examples%2F&amp;linkname=mysqli-examples" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fmysqli-examples%2F&amp;linkname=mysqli-examples" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fmysqli-examples%2F&#038;title=mysqli-examples" data-a2a-url="https://mitindia.in/mysqli-examples/" data-a2a-title="mysqli-examples"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/mysqli-examples/">mysqli-examples</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
