<?php include 'main_class.php'; $obj = new parent_data(); //$result = $obj->select_full('countries'); //$country_result = mysql_fetch_assoc($result); $user_all = $obj->select_full('register'); //$user_res = mysql_fetch_assoc($user_all); $username = array(); //if we dont write this then also the below process will work as it suppose to be but if there is no data will come in $username during the loop then error will occur and here we r using $username variable in the jquery process also and functionality of jquery will halt by giving error if the $username will blank and so we define it as array in the starting to overcome all of these problems. while ($user_res = mysql_fetch_assoc($user_all)) { $username[] = $user_res['username']; } $st_json = json_encode($username); //json_encode function convert php data into json format,we can use this data in java or json if we want. ?> <!DOCTYPE html > <html> <head> <style> .user_exist_cla{ border-color:red; background-color:red; } .error { color: #D8000C; background-color: #FFBABA; } </style> <title>A FORM </title>
<?php include 'main_class.php'; $obj = new parent_data(); $result = $obj->select_full('register'); //$row = mysql_fetch_assoc($result); /* while($row= mysql_fetch_assoc($result)){ echo '<pre>'; print_r($row); echo '</pre>'; } */ /* $username = '******'; $password = '******'; $tablename = 'register'; $id = 4; $dbfname = array('username'=>$username,'password'=>$password); $obj->update_database($tablename,$dbfname,$id); */ /* $res = mysql_fetch_array($result); print_r($res); */ $str = 'This is THE name'; echo $str_ch = strtolower($str);