<?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>PHP MySQLi Functions for Beginners - Cody Paste</title>
	<atom:link href="https://www.codypaste.com/category/mysqli/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codypaste.com/category/mysqli/</link>
	<description>THE WEB PLAYGROUND</description>
	<lastBuildDate>Tue, 17 Dec 2024 11:36:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.codypaste.com/wp-content/uploads/2022/12/cropped-codypaste-32x32.png</url>
	<title>PHP MySQLi Functions for Beginners - Cody Paste</title>
	<link>https://www.codypaste.com/category/mysqli/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Increase file upload size phpMyAdmin</title>
		<link>https://www.codypaste.com/increase-file-upload-size-phpmyadmin/</link>
					<comments>https://www.codypaste.com/increase-file-upload-size-phpmyadmin/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 17 Dec 2024 11:36:56 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://www.codypaste.com/?p=1251</guid>

					<description><![CDATA[<p>Step-By-Step Instructions 1. Login to WHM as the root user. 2. Navigate to &#8220;&#8221;Home / Server Configuration / Tweak Settings&#8221;&#8221; in WHM. 3. Click on the PHP tab. 4. For the &#8220;&#8221;cPanel PHP max upload size&#8221;&#8221; option, increase the upload limit to your desired value. a. Values higher than 2047MB are not permitted. 5. For &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/increase-file-upload-size-phpmyadmin/" class="more-link">read more<span class="screen-reader-text"> "Increase file upload size phpMyAdmin"</span></a></p>
<p>The post <a href="https://www.codypaste.com/increase-file-upload-size-phpmyadmin/">Increase file upload size phpMyAdmin</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Step-By-Step Instructions<br />
1. Login to WHM as the root user.</p>
<p>2. Navigate to &#8220;&#8221;Home / Server Configuration / Tweak Settings&#8221;&#8221; in WHM.</p>
<p>3. Click on the PHP tab.</p>
<p>4. For the &#8220;&#8221;cPanel PHP max upload size&#8221;&#8221; option, increase the upload limit to your desired value.</p>
<p>a. Values higher than 2047MB are not permitted.</p>
<p>5. For the &#8220;&#8221;cPanel PHP max POST size&#8221;&#8221; option, increase the POST value to the same or higher.</p>
<p>a. Values higher than 2047MB are not permitted.</p>
<p>6. Click Save.</p>
<p>Once this is done, you&#8217;ll see that phpMyAdmin now shows the new maximum upload size on the import screen next to the upload button.</p>
<p>The post <a href="https://www.codypaste.com/increase-file-upload-size-phpmyadmin/">Increase file upload size phpMyAdmin</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/increase-file-upload-size-phpmyadmin/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Export Large Database in cPanel by SSH Command</title>
		<link>https://www.codypaste.com/export-large-database-in-cpanel-by-ssh-command/</link>
					<comments>https://www.codypaste.com/export-large-database-in-cpanel-by-ssh-command/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Wed, 18 Sep 2024 06:10:22 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://www.codypaste.com/?p=1175</guid>

					<description><![CDATA[<p>To export a large MySQL database via the command line, you use the mysqldump utility. Here’s the basic syntax and steps for exporting a large database: Basic Syntax mysqldump -u username -p database_name &#62; /path/to/backup_file.sql Steps to Export a Large Database Open Your Terminal: Access the command line interface on your server or local machine. &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/export-large-database-in-cpanel-by-ssh-command/" class="more-link">read more<span class="screen-reader-text"> "Export Large Database in cPanel by SSH Command"</span></a></p>
<p>The post <a href="https://www.codypaste.com/export-large-database-in-cpanel-by-ssh-command/">Export Large Database in cPanel by SSH Command</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>To export a large MySQL database via the command line, you use the <code>mysqldump</code> utility. Here’s the basic syntax and steps for exporting a large database:</p>
<h3>Basic Syntax</h3>
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mysqldump -u username -p database_name &gt; /path/to/backup_file.sql<br />
</code></div>
</div>
<h3>Steps to Export a Large Database</h3>
<p><strong>Open Your Terminal:</strong></p>
<p>Access the command line interface on your server or local machine.</p>
<ol>
<li><strong>Run the <code>mysqldump</code> Command:</strong>
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mysqldump -u your_database_user -p your_database_name &gt; /path/to/backup_file.sql</code><code class="!whitespace-pre hljs language-bash"></code></div>
</div>
<p>&nbsp;</li>
<li><strong>Enter the Password:<br />
</strong><span style="font-size: 1rem;">After running the command, you’ll be prompted to enter the password for </span><code>your_database_user</code><span style="font-size: 1rem;">. Type in the password and press Enter.</span></li>
</ol>
<h3>Additional Options</h3>
<ul>
<li><strong>Compress the Backup File:</strong> To save space, you can compress the SQL file using gzip:
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mysqldump -u your_database_user -p your_database_name | gzip &gt; /path/to/backup_file.sql.gz</code></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"></code></div>
</div>
<p>To decompress and restore later:<br />
<span style="background-color: #f2f4f5; color: #222222; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 0.9375rem;">gunzip &lt; /path/to/backup_file.sql.gz | mysql -u your_database_user -p your_database_name</span></li>
<li><strong>Include Specific Tables:</strong> If you want to export specific tables, list them after the database name:<br />
<span style="background-color: #f2f4f5; color: #222222; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 0.9375rem;">mysqldump -u your_database_user -p your_database_name table1 table2 &gt; /path/to/backup_file.sql</span></li>
<li><strong>Export Only the Schema:</strong> To export only the schema (structure) without data:
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="sticky top-9 md:top-[5.75rem]"></div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mysqldump -u your_database_user -p -d your_database_name &gt; /path/to/backup_schema.sql</p>
<p></code></div>
</div>
</li>
<li><strong>Export Only Data:</strong> To export only the data (without schema):
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mysqldump -u your_database_user -p --no-create-info your_database_name &gt; /path/to/backup_data.sq</code></div>
</div>
</li>
</ul>
<h3>Troubleshooting Tips</h3>
<ul>
<li><strong>Ensure Enough Disk Space:</strong> Make sure there’s enough disk space on your server or local machine to store the backup file.</li>
<li><strong>Handling Large Databases:</strong> For very large databases, consider using options like <code>--single-transaction</code> to avoid locking the tables:
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash">mysqldump -u your_database_user -p --single-transaction your_database_name &gt; /path/to/backup_file.sql</p>
<p></code></div>
</div>
</li>
<li><strong>Check Permissions:</strong> Ensure that the user has the required permissions to perform the dump operation.</li>
</ul>
<p>If you encounter issues or errors, they may provide more specific details on what needs to be addressed, such as permissions, disk space, or specific database settings.</p>
<p>The post <a href="https://www.codypaste.com/export-large-database-in-cpanel-by-ssh-command/">Export Large Database in cPanel by SSH Command</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/export-large-database-in-cpanel-by-ssh-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Import Large Database in cPanel by SSH Command</title>
		<link>https://www.codypaste.com/import-large-database-in-cpanel-by-ssh-command/</link>
					<comments>https://www.codypaste.com/import-large-database-in-cpanel-by-ssh-command/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Wed, 18 Sep 2024 05:43:58 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://www.codypaste.com/?p=1170</guid>

					<description><![CDATA[<p>Importing large database from phpmyadmin Import is difficult because of time limit and file size, so here we will see how to import large databases in phpmyadmin or cPanel using SSH. You can use the &#8216;Terminal&#8217; Option from Cpanel or PuTTY for command. Here we will use &#8216;Terminal&#8217;. &#160; STEP 1: Go to public_html directory &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/import-large-database-in-cpanel-by-ssh-command/" class="more-link">read more<span class="screen-reader-text"> "Import Large Database in cPanel by SSH Command"</span></a></p>
<p>The post <a href="https://www.codypaste.com/import-large-database-in-cpanel-by-ssh-command/">Import Large Database in cPanel by SSH Command</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Importing large database from phpmyadmin Import is difficult because of time limit and file size,<br />
so here we will see how to import large databases in phpmyadmin or cPanel using SSH.</p>
<p>You can use the &#8216;Terminal&#8217; Option from Cpanel or PuTTY for command.</p>
<p>Here we will use &#8216;Terminal&#8217;.</p>
<p>&nbsp;</p>
<p><strong>STEP 1:</strong><br />
Go to <strong>public_html</strong> directory<br />
<em>Type in terminal</em></p><pre class="urvanov-syntax-highlighter-plain-tag">cd public_html</pre><p>&nbsp;</p>
<p><strong>STEP 2:</strong><br />
Type</p><pre class="urvanov-syntax-highlighter-plain-tag">mysql -u your_DB_username -p your_db_name &lt; path_of_your_sql_file.sql</pre><p>Press Enter</p>
<p>&nbsp;</p>
<p><strong>STEP 3:</strong><br />
This will ask for password: Type the Database password of your DB</p>
<p>and wait&#8230; your data will imported successfully</p>
<p>&nbsp;</p>
<p>The post <a href="https://www.codypaste.com/import-large-database-in-cpanel-by-ssh-command/">Import Large Database in cPanel by SSH Command</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/import-large-database-in-cpanel-by-ssh-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Load More style Pagination in PHP/MYSQLi</title>
		<link>https://www.codypaste.com/lode-more-pagination-in-phpmysqli/</link>
					<comments>https://www.codypaste.com/lode-more-pagination-in-phpmysqli/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 29 Sep 2016 10:03:11 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=511</guid>

					<description><![CDATA[<p>Author: CodexWorldAuthor URL: http://www.codexworld.com/Author Email: contact@codexworld.comTutorial Link: http://www.codexworld.com/load-more-data-using-jquery-ajax-php-from-database/ ============ Instruction ============Create a database (test) at phpMyAdmin =&#62; Import the &#8220;tutorials.sql&#8221; file into this database =&#62; Move &#8220;load_more_data_jquery_ajax/&#8221; directory at the localhost =&#62; Open the &#8220;index.php&#8221; file at the browser =&#62; Test functionality. ========================================================================== Step: 1 index.php [crayon-69ab96e88c577428052000/] &#160; &#160; Step 2: conn.php (DB connection) connection &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/lode-more-pagination-in-phpmysqli/" class="more-link">read more<span class="screen-reader-text"> "Load More style Pagination in PHP/MYSQLi"</span></a></p>
<p>The post <a href="https://www.codypaste.com/lode-more-pagination-in-phpmysqli/">Load More style Pagination in PHP/MYSQLi</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Author: CodexWorld<br />Author URL: http://www.codexworld.com/<br />Author Email: contact@codexworld.com<br />Tutorial Link: <a href="http://www.codexworld.com/load-more-data-using-jquery-ajax-php-from-database/" target="_blank" rel="nofollow">http://www.codexworld.com/load-more-data-using-jquery-ajax-php-from-database/</a></p>
<p>============ Instruction ============<br />Create a database (test) at phpMyAdmin =&gt; Import the &#8220;tutorials.sql&#8221; file into this database =&gt; Move &#8220;load_more_data_jquery_ajax/&#8221; directory at the localhost =&gt; Open the &#8220;index.php&#8221; file at the browser =&gt; Test functionality.</p>
<p>==========================================================================</p>
<p><strong>Step: 1 index.php</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;!DOCTYPE html&gt;
&lt;html lang='en-US' xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Load more data using jQuery, Ajax and PHP&lt;/title&gt;
&lt;style type="text/css"&gt;

.tutorial_list{ 
margin-bottom:20px;
}
div.list_item {
	border-bottom:dotted 1px #CCC;
	padding-top:10px;
	padding-bottom:10px;
}
div.list_item {
margin: 5px 0px 2px;
}
div.list_item p {
margin: .5em 0;
padding: 2px;
font-size: 13px;
line-height: 1.5;
}
.list_item a {
text-decoration: none;
padding-bottom: 2px;
color: #000;
-webkit-transition-property: border,background,color;
transition-property: border,background,color;-webkit-transition-duration: .05s;
transition-duration: .05s;
-webkit-transition-timing-function: ease-in-out;
transition-timing-function: ease-in-out;
font-weight:bold;
}
.list_item a:hover{ 
text-decoration:underline;
}
.show_more_main {
margin: 15px 0px;
}
.show_more {
background-color: #f8f8f8;
background-image: -webkit-linear-gradient(top,#fcfcfc 0,#f8f8f8 100%);
background-image: linear-gradient(top,#fcfcfc 0,#f8f8f8 100%);
border: 1px solid;
border-color: #d3d3d3;
color: #333;
font-size: 12px;
outline: 0;
}
.show_more {
cursor: pointer;
display: block;
padding: 10px 0;
text-align: center;
font-weight:bold;
}
.loding {
background-color: #e9e9e9;
border: 1px solid;
border-color: #c6c6c6;
color: #333;
font-size: 12px;
display: block;
text-align: center;
padding: 10px 0;
outline: 0;
font-weight:bold;
}
.loding_txt {
background-image: url(loading_16.gif);
background-position: left;
background-repeat: no-repeat;
border: 0;
display: inline-block;
height: 16px;
padding-left: 20px;
}

&lt;/style&gt;
&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$(document).ready(function(){
	$(document).on('click','.show_more',function(){
		var ID = $(this).attr('id');
		$('.show_more').hide();
		$('.loding').show();
		$.ajax({
			type:'POST',
			url:'ajax_more.php',
			data:'id='+ID,
			success:function(html){
				$('#show_more_main'+ID).remove();
				$('.tutorial_list').append(html);
			}
		});
		
	});
});
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;?php
//include database configuration file
include('conn.php');
?&gt;

        	
            &lt;div class="tutorial_list"&gt;
			&lt;?php
			//get rows query
			$query = mysqli_query($db, "SELECT * FROM yout_db_table ORDER BY id DESC LIMIT 6");
			
			//number of rows
			$rowCount = mysqli_num_rows($query);
			
			if($rowCount &gt; 0){ 
				while($row = mysqli_fetch_assoc($query)){ 
                    $tutorial_id = 	$row['id'];
            ?&gt;
           	 	&lt;div class="list_item"&gt;
                &lt;div&gt;&lt;a href="&lt;?php echo $row['link']; ?&gt;" target="_blank"&gt;&lt;?php echo $row['title']; ?&gt;&lt;/a&gt;&lt;/div&gt;
                &lt;div&gt;&lt;?php echo $row['sub_title']; ?&gt;&lt;/div&gt;
                &lt;/div&gt;
            &lt;?php } ?&gt;
            &lt;div class="show_more_main" id="show_more_main&lt;?php echo $tutorial_id; ?&gt;"&gt;
                &lt;span id="&lt;?php echo $tutorial_id; ?&gt;" class="show_more" title="Load more posts"&gt;Show more&lt;/span&gt;
                &lt;span class="loding" style="display: none;"&gt;&lt;span class="loding_txt"&gt;Loading...&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
            &lt;?php } ?&gt;
            &lt;/div&gt;


&lt;/body&gt;
&lt;/html&gt;</pre><p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Step 2: conn.php (DB connection)</strong></p>
<p>connection for server:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
$db = mysqli_connect("localhost","root","pass","db_name");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?&gt;</pre><p></p>
<p>connection for localhost:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

$db = mysqli_connect("localhost","root","pass","db_name");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?&gt;</pre><p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Step 3: ajax_more</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
if(isset($_POST["id"]) &amp;&amp; !empty($_POST["id"])){

//include database configuration file
include('conn.php');

//count all rows except already displayed
$queryAll = mysqli_query($db,"SELECT COUNT(*) as num_rows FROM your_db_name WHERE id &lt; ".$_POST['id']." ORDER BY id DESC");
$row = mysqli_fetch_assoc($queryAll);
$allRows = $row['num_rows'];

$showLimit = 4;

//get rows query
$query = mysqli_query($db, "SELECT * FROM newsletters WHERE id &lt; ".$_POST['id']." ORDER BY id DESC LIMIT ".$showLimit);

//number of rows
$rowCount = mysqli_num_rows($query);

if($rowCount &gt; 0){ 
    while($row = mysqli_fetch_assoc($query)){ 
        $tutorial_id = $row["id"]; ?&gt;
        &lt;div class="list_item"&gt;
        &lt;div&gt;&lt;a href="&lt;?php echo $row['link']; ?&gt;" target="_blank"&gt;&lt;?php echo $row["title"]; ?&gt;&lt;/a&gt;&lt;/div&gt;
         &lt;div&gt;&lt;?php echo $row['sub_title']; ?&gt;&lt;/div&gt;
        &lt;/div&gt;
&lt;?php } ?&gt;
&lt;?php if($allRows &gt; $showLimit){ ?&gt;
    &lt;div class="show_more_main" id="show_more_main&lt;?php echo $tutorial_id; ?&gt;"&gt;
        &lt;span id="&lt;?php echo $tutorial_id; ?&gt;" class="show_more" title="Load more posts"&gt;Show more&lt;/span&gt;
        &lt;span class="loding" style="display: none;"&gt;&lt;span class="loding_txt"&gt;Loading…&lt;/span&gt;&lt;/span&gt;
    &lt;/div&gt;
&lt;?php } ?&gt;  
&lt;?php 
    } 
}
?&gt;</pre><p></p>
<p>&nbsp;</p>
<p>The post <a href="https://www.codypaste.com/lode-more-pagination-in-phpmysqli/">Load More style Pagination in PHP/MYSQLi</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/lode-more-pagination-in-phpmysqli/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Delete query in Mysqli</title>
		<link>https://www.codypaste.com/delete-query-in-mysqli/</link>
					<comments>https://www.codypaste.com/delete-query-in-mysqli/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 23 Apr 2016 14:30:51 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=402</guid>

					<description><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/delete-query-in-mysqli/" class="more-link">read more<span class="screen-reader-text"> "Delete query in Mysqli"</span></a></p>
<p>The post <a href="https://www.codypaste.com/delete-query-in-mysqli/">Delete query in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8211; with a hat-tip to the one way that you <strong>definitely</strong> shouldn&#8217;t be doing it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>$db variable require which we used in DB connection. e.g.</strong></p>
<p>&nbsp;</p>
<p><strong>DB Connection:</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

$db = new mysqli('localhost', 'root', '', 'popink');

if($db-&gt;connect_errno &gt; 0){
    die('Unable to connect to database [' . $db-&gt;connect_error . ']');
}
?&gt;</pre><p></p>
<p>&nbsp;</p>
<p><strong>Unlink/Delete uploaded file from folder:</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

$result = mysqli_query($db,"SELECT * FROM home_slider WHERE id='$id'");
$row = mysqli_fetch_array($result);
			
				
$old_file2="../images/slider/$row[banner]";

$del2= unlink($old_file2);


?&gt;</pre><p></p>
<p>&nbsp;</p>
<p><strong>Delete Query:</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">$delete=$db-&gt;query("DELETE FROM home_slider WHERE id='$id'") ;</pre><p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Source: <a href="http://codular.com/php-mysqli">http://codular.com/php-mysqli</a></p>
<p>The post <a href="https://www.codypaste.com/delete-query-in-mysqli/">Delete query in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/delete-query-in-mysqli/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Update query in Mysqli</title>
		<link>https://www.codypaste.com/update-query-in-mysqli/</link>
					<comments>https://www.codypaste.com/update-query-in-mysqli/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 23 Apr 2016 14:19:27 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=400</guid>

					<description><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/update-query-in-mysqli/" class="more-link">read more<span class="screen-reader-text"> "Update query in Mysqli"</span></a></p>
<p>The post <a href="https://www.codypaste.com/update-query-in-mysqli/">Update query in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8211; with a hat-tip to the one way that you <strong>definitely</strong> shouldn&#8217;t be doing it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>$db require, which is DB connection variable. e.g.</strong></p>
<p><strong>DB Connection:</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

$db = new mysqli('localhost', 'root', '', 'popink');

if($db-&gt;connect_errno &gt; 0){
    die('Unable to connect to database [' . $db-&gt;connect_error . ']');
}
?&gt;</pre><p></p>
<p><strong> Update Query:</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

$id=$_REQUEST['id'];
$link=$_POST['link'];
     
$code=time();
						
$updates=$db-&gt;query("Update home_slider SET link='$link' WHERE id='$id'") ;

?&gt;</pre><p></p>
<p>&nbsp;</p>
<p>The post <a href="https://www.codypaste.com/update-query-in-mysqli/">Update query in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/update-query-in-mysqli/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Insert query in Mysqli</title>
		<link>https://www.codypaste.com/insert-query-in-mysqli/</link>
					<comments>https://www.codypaste.com/insert-query-in-mysqli/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 23 Apr 2016 14:05:38 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=395</guid>

					<description><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/insert-query-in-mysqli/" class="more-link">read more<span class="screen-reader-text"> "Insert query in Mysqli"</span></a></p>
<p>The post <a href="https://www.codypaste.com/insert-query-in-mysqli/">Insert query in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8211; with a hat-tip to the one way that you <strong>definitely</strong> shouldn&#8217;t be doing it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Insert query</strong> &amp; <strong>move uploaded file</strong> in Mysqli</p>
<p>database connection is must under function for this query if using classes.</p>
<p><strong>DB Connection:</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

$db = new mysqli('localhost', 'root', '', 'database');

if($db-&gt;connect_errno &gt; 0){
die('Unable to connect to database [' . $db-&gt;connect_error . ']');
}

?&gt;</pre><p></p>
<p><strong> INSERT Query:</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

   $banner=$_FILES['banner'];  
   $bannername1=urlencode($banner['name']);
   $bannername2=str_replace("+", "_", $bannername1);
   $bannername=str_replace("-", "_", $bannername2);   

   
   $code=time();
   $position="0";
   $status="on";
   $link=urlencode($_POST['link']);
   $des="none";



$insert=mysqli_query($db,"INSERT INTO TableName (`banner`,`des`,`position`,`status`,`link`)
VALUES ('$code$bannername','$des','$position','$status','$link')") 
or die(mysqli_error($db));

move_uploaded_file($banner['tmp_name'], "../images/slider/$code$bannername");

?&gt;</pre><p></p>
<p>&nbsp;</p>
<p>The post <a href="https://www.codypaste.com/insert-query-in-mysqli/">Insert query in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/insert-query-in-mysqli/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Select query in Mysqli</title>
		<link>https://www.codypaste.com/select-query-in-mysqli/</link>
					<comments>https://www.codypaste.com/select-query-in-mysqli/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 23 Apr 2016 13:33:38 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=392</guid>

					<description><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/select-query-in-mysqli/" class="more-link">read more<span class="screen-reader-text"> "Select query in Mysqli"</span></a></p>
<p>The post <a href="https://www.codypaste.com/select-query-in-mysqli/">Select query in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8211; with a hat-tip to the one way that you <strong>definitely</strong> shouldn&#8217;t be doing it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Select db table &amp; result in while loop</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php
$res_view = mysqli_query($db,"SELECT * FROM home_slider ORDER BY position");
while($row_view = mysqli_fetch_array($res_view))
{
echo $row_view['banner']; 
}
?&gt;</pre><p></p>
<p>here &#8216;$db&#8217; variable is <a href="http://www.codypaste.com/database-connection-in-mysqli/" target="_blank">db connection variable</a></p>
<p>The post <a href="https://www.codypaste.com/select-query-in-mysqli/">Select query in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/select-query-in-mysqli/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Database connection in Mysqli</title>
		<link>https://www.codypaste.com/database-connection-in-mysqli/</link>
					<comments>https://www.codypaste.com/database-connection-in-mysqli/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 23 Apr 2016 12:19:52 +0000</pubDate>
				<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=388</guid>

					<description><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/database-connection-in-mysqli/" class="more-link">read more<span class="screen-reader-text"> "Database connection in Mysqli"</span></a></p>
<p>The post <a href="https://www.codypaste.com/database-connection-in-mysqli/">Database connection in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven&#8217;t yet taken the step to interacting with databases properly in PHP. Here we guide you through what you should be doing &#8211; using PHP&#8217;s MySQLi class &#8211; with a hat-tip to the one way that you <strong>definitely</strong> shouldn&#8217;t be doing it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">$db = new mysqli('localhost', 'user', 'pass', 'demo');

if($db-&gt;connect_errno &gt; 0){
    die('Unable to connect to database [' . $db-&gt;connect_error . ']');
}</pre><p></p>
<p>user -&gt; db user name</p>
<p>pass -&gt; db password</p>
<p>demo -&gt; database name</p>
<p>&nbsp;</p>
<p>The post <a href="https://www.codypaste.com/database-connection-in-mysqli/">Database connection in Mysqli</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/database-connection-in-mysqli/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
