<?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>category by Subcategory Archives - Codeplaners</title>
	<atom:link href="https://codeplaners.com/tag/category-by-subcategory/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/tag/category-by-subcategory/</link>
	<description>Code Solution</description>
	<lastBuildDate>Wed, 01 Jan 2025 06:38:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>

<image>
	<url>https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-32x32.png</url>
	<title>category by Subcategory Archives - Codeplaners</title>
	<link>https://codeplaners.com/tag/category-by-subcategory/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Select Option Subcategory By Category In PHP</title>
		<link>https://codeplaners.com/select-option-subcategory-by-category-in-php/</link>
					<comments>https://codeplaners.com/select-option-subcategory-by-category-in-php/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 08 Dec 2024 05:09:28 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[category by Subcategory]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHP 8]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1438</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:38 amHi Dev, Today, i we will show you select option subcategory by category in php. This article will give you simple example of select option subcategory by category in php. you will select option subcategory by category in php. In this article, we will &#8230; <a href="https://codeplaners.com/select-option-subcategory-by-category-in-php/" class="more-link">Continue reading<span class="screen-reader-text"> "Select Option Subcategory By Category In PHP"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/select-option-subcategory-by-category-in-php/">Select Option Subcategory By Category In PHP</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:38 am</p><p>Hi Dev,</p>
<p>Today, i we will show you select option subcategory by category in php. This article will give you simple example of select option subcategory by category in php. you will select option subcategory by category in php. In this article, we will implement a select option subcategory by category in php. </p>
<p>So let’s follow few step to create example of select option subcategory by category in php.</p>
<h3 class="step_code">database.php</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
	$servername = &quot;localhost&quot;;
	$username = &quot;root&quot;;
	$password = &quot;&quot;;
	$db=&quot;example&quot;;
	$conn = mysqli_connect($servername, $username, $password,$db);
?&gt;
</pre>
<h3 class="step_code">index.php</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
include 'database.php';
$result = mysqli_query($conn,&quot;SELECT * FROM category&quot;);
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
  &lt;title&gt;Select Option Subcategory By Category In PHP - Codeplaners&lt;/title&gt;
  &lt;meta charset=&quot;utf-8&quot;&gt;
  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css&quot;&gt;
  &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;container&quot;&gt;
	&lt;form&gt;
		&lt;div class=&quot;form-group&quot;&gt;
		  &lt;label &gt;Category&lt;/label&gt;
		  &lt;select class=&quot;form-control&quot; id=&quot;category&quot;&gt;
		  &lt;option value=&quot;&quot;&gt;Select Category&lt;/option&gt;
		    &lt;?php
			while($row = mysqli_fetch_array($result)) {
			?&gt;
				&lt;option value=&quot;&lt;?php echo $row&#x5B;&quot;id&quot;];?&gt;&quot;&gt;&lt;?php echo $row&#x5B;&quot;category_name&quot;];?&gt;&lt;/option&gt;
			&lt;?php
			}
			?&gt;
			
		  &lt;/select&gt;
		&lt;/div&gt;
		&lt;div class=&quot;form-group&quot;&gt;
		  &lt;label for=&quot;sel1&quot;&gt;Sub Category&lt;/label&gt;
		  &lt;select class=&quot;form-control&quot; id=&quot;sub_category&quot;&gt;
			
		  &lt;/select&gt;
		&lt;/div&gt;
	&lt;/form&gt;
&lt;/div&gt;
&lt;script&gt;
$(document).ready(function() {
	$('#category').on('change', function() {
			var category_id = this.value;
			$.ajax({
				url: &quot;get_subcat.php&quot;,
				type: &quot;POST&quot;,
				data: {
					category_id: category_id
				},
				cache: false,
				success: function(dataResult){
					$(&quot;#sub_category&quot;).html(dataResult);
				}
			});
		
		
	});
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3 class="step_code">get_subcat.php</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
	include 'database.php';
	$category_id=$_POST&#x5B;&quot;category_id&quot;];
	$result = mysqli_query($conn,&quot;SELECT * FROM category where category_id=$category_id&quot;);
?&gt;
&lt;option value=&quot;&quot;&gt;Select SubCategory&lt;/option&gt;
&lt;?php
while($row = mysqli_fetch_array($result)) {
?&gt;
	&lt;option value=&quot;&lt;?php echo $row&#x5B;&quot;id&quot;];?&gt;&quot;&gt;&lt;?php echo $row&#x5B;&quot;subcategory_name&quot;];?&gt;&lt;/option&gt;
&lt;?php
}
?&gt;
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/select-option-subcategory-by-category-in-php/">Select Option Subcategory By Category In PHP</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/select-option-subcategory-by-category-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
