<?php$con = mysqli_connect(“localhost”,”my_user”,”my_password”,”my_db”);// Check connectionif (mysqli_connect_errno()) { echo “Failed to connect to MySQL: ” . mysqli_connect_error();}if ($_SERVER[“REQUEST_METHOD”] == “POST”) { //unsafe data $unsafe_name = mysqli_real_escape_string($con, […]
Multiple words of string replace with str_replace in PHP
<?php ## Converting utf8 characters to iso-88591 manually in PHP echo “<meta http-equiv=’Content-Type’ content=’text/html; charset=UTF-8′ />”; function str_replace_char(){ $find = array(‘“’, ‘’’, […]
Set only first letter capital other in lowercase in PHP SQL
$sql = “SELECT concat(left(emp_name,1),substring(lower(emp_name),2)) as emp_name FROM employee”; Input : “Raj Kumar”Output : “Raj kumar”
How to Merge Multiple .sql Tables/files Into a Single File?
1. Goto cmd 2. Type in command prompt C:usersUsersname>cd [.sql tables folder path ] Press Enter Ex: C:usersUsersname>cd E:projectdatabase 3. Type command prompt C:usersUsersname>[.sql folder’s […]
How to create Stored Procedures for Insert,Update,Delete,Login in PHP?
<?phpSTEP – 1 #### Create Insert Data Store Procedure In PHP ##### First Create Table# Table structure for table `users`CREATE TABLE IF NOT EXISTS `users` […]