Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Category: PHP

PHP

WordPress Images Killing Performance — Missing Sizes

- 17.12.25 - ErcanOPAK comment on WordPress Images Killing Performance — Missing Sizes

Uploading huge images without resizing is deadly. ✅ Fix Always use: the_post_thumbnail(‘medium_large’);  

Read More
PHP / Wordpress

WP “Menus Not Saving” — The Max Input Vars Killer

- 11.12.25 - ErcanOPAK comment on WP “Menus Not Saving” — The Max Input Vars Killer

Your menu refuses to save?You click save → NOTHING. ✔ Fix in php.ini: max_input_vars = 3000 Or WP-level: @ini_set( ‘max_input_vars’ , 3000 ); 💡 Why It Happens Large menus exceed PHP’s default 1000 variable limit.

Read More
PHP / Wordpress

How to solve “PHP Update Required” warning on WordPress

- 14.09.19 | 22.11.19 - ErcanOPAK comment on How to solve “PHP Update Required” warning on WordPress

The WordPress open-source content management system (CMS) will show warnings in its backend admin panel if the site runs on top of an outdated PHP version. The short-term plan is to migrate as many active users to more recent versions of PHP as possible so that the WordPress team can drop support for older PHP […]

Read More
MySQL / PHP

mysql_connect() in PHP 7

- 14.09.19 | 22.11.19 - ErcanOPAK comment on mysql_connect() in PHP 7

After upgrading  to  PHP 7.x from PHP 5.x, you start getting  error of “Call to undefined”. This is because mysql_* functions are completely removed from PHP 7, it was get deprecated in PHP 5.5 but now it is completely removed. The older mysql function are removed due to following reasons: Not work on Object Oriented […]

Read More
PHP

How to show a button with condition in PHP

- 26.05.19 | 22.11.19 - ErcanOPAK comment on How to show a button with condition in PHP

Scenario: Let’s say we have “Get Details” and “Update Details” buttons. And we want to make visible Update button after we fire the “Get Details” button. This is Get Details button:

Read More
ASP.Net WebForms / HTML / PHP

Navigate to a Div using a button in HTML

- 26.05.19 | 22.11.19 - ErcanOPAK comment on Navigate to a Div using a button in HTML

The Div: <div id=”DivToNavigate”> The content goes here… </div>

Read More
MySQL / PHP

Repeater Function in PHP

- 05.05.19 | 22.11.19 - ErcanOPAK comment on Repeater Function in PHP

You need to do a while loop to pull each rowset. mysql_fetch_array() will only pull one row at a time. Consider this solution: <?php $dbhost = ‘xxxx’; $dbuser = ‘xxxx’; $dbpass = ‘xxxx’; $dbname = ‘xxxx’; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’); mysql_select_db($dbname, $conn); $result = mysql_query(“SELECT * FROM mytable”, $conn); <table> […]

Read More
MySQL / PHP

How do you connect to multiple MySQL databases on a single webpage?

- 05.05.19 | 14.04.20 - ErcanOPAK comment on How do you connect to multiple MySQL databases on a single webpage?

You can make multiple calls to mysql_connect(), but if the parameters are the same you need to pass true for the ‘$new_link‘ (fourth) parameter, otherwise the same connection is reused.

Read More
PHP

How to connect MySQL Database with PHP

- 22.04.19 | 22.11.19 - ErcanOPAK comment on How to connect MySQL Database with PHP

You can try code below:

Read More
PHP / Wordpress

Disable REST API Plugin

- 21.04.19 | 22.11.19 - ErcanOPAK comment on Disable REST API Plugin

Disable the REST API with a Plugin: If you want to try a completely different solution you can try out https://wordpress.org/plugins/disable-json-api/ which takes care of removing the REST API functionlity for you. Disable the REST API without a Plugin: Maybe you don’t use any security plugins. While I recommend that you reconsider and install either WordFence or […]

Read More
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (859)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (754)
  • Add Constraint to SQL Table to ensure email contains @ (578)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (564)
  • Average of all values in a column that are not zero in SQL (531)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (489)
  • Find numbers with more than two decimal places in SQL (448)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (859)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (754)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com