Search
 
SCRIPT & CODE EXAMPLE
 

SQL

check_username

$(document).ready(function(){

   $("#txt_username").keyup(function(){

      var username = $(this).val().trim();

      if(username != ''){

         $.ajax({
            url: 'ajaxfile.php',
            type: 'post',
            data: {username:username},
            success: function(response){

               // Show response
               $("#uname_response").html(response);

            }
         });
      }else{
         $("#uname_response").html("");
      }

   });

});
Comment

check_username

<?php
include 'config.php';

if(isset($_POST['username'])){
   $username = $_POST['username'];

   // Check username
   $sql = "select count(*) as allcount from users where username=$1";
   $result = pg_query_params($con, $sql, array($username));
   $row = pg_fetch_assoc($result);
   $count = $row['allcount'];

   $response = "<span style='color: green;'>Available</span>";
   if($count > 0){
      $response = "<span style='color: red;'>Not Available</span>";
   }

   echo $response;
   exit;
}
Comment

PREVIOUS NEXT
Code Example
Sql :: row = 1 oracle sql 
Sql :: sql find column with trailing space 
Sql :: create synonym for dblink in oracle 
Sql :: how to add postgres table in netbeans 
Sql :: hoq to import database source 
Sql :: group_concat only returns one row 
Sql :: convert sql query to linq online 
Sql :: how get data from database if id not found then search another column 
Sql :: mysql desactivar trigger 
Sql :: subquery aggregation 
Sql :: stored procedure function relation 
Sql :: oracle date summer time 
Sql :: dynamic where clause in sql server stored procedure 
Sql :: how to set all the min and sec data to zero in sql server 
Sql :: How to return only the Date from a SQL Server DateTime datatype 
Sql :: postgresql select fast check no rows 
Sql :: postgres audit table 
Sql :: http://localhost:9200/_cluster/allocation/explain 
Sql :: fill a coulmn with a certain value sql 
Sql :: How to Alter column in SQL Server - NAYCode.com 
Sql :: mysql service not starting 
Sql :: odata expand and $select only column values 
Sql :: How to write triggers to increment or decrement the number of employees 
Sql :: upload multipe databases mysql 
Sql :: select-groups-of-row-only-having-specific-value 
Sql :: install phpmyadmin pma 
Sql :: sql redshift split into first and last name 
Sql :: sql select column name like from multiple tables 
Sql :: mysqli count down 
Sql :: fast sql column count 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =