MySQL

MySQL query issue

This is my query: SELECT count(*) as total, dp.name,dp.id,dp.description, dp.avatar FROM `doctors` d right join departments dp on d.department_id = dp.id group by d.department_id I have to tables: doctors and departments. I want to extract the total number of doctors from each department. This query works fine, it returns me all of the deparments, which have a doctors, but not…
Read more

Solr search integration with php

Is there any good tutorial for solr search with php integration. I have solr on my local machine and its working fine when I am hitting this url ‘http://localhost:8983/solr/’ but I am new in solr search and unable to find any tutorial which will help me for configuring php and mysql with solr. I am using windows8 and solr5.1.0. If…
Read more

how to create login and register account with validation using preg_match

**//login.php <?php include(‘db/connection.php’); error_reporting(0); session_start(); if(isset($_POST[‘submit’])){ $username = $_POST[‘username’]; $password = $_POST[‘password’]; $username = str_replace(‘ ‘, ”, $username); if ($username == null || empty($password)) { $userCheck = ” *Username or Password field is required”; $errorCheck = 1; } else if (!preg_match(‘/^[a-z0-9_]{5,12}$/’, $username)) { $userCheck = ” *Username must have at least 5-12 characters”; $errorCheck = 1; } else { $errorCheck…
Read more

mysql in Xampp Not work

after update kernel to 4.0.3 in ubuntu phpmadmin in xampp not work i try this sudo /opt/lampp/lampp start Starting XAMPP for Linux 5.6.8-0… XAMPP: Starting Apache…ok. XAMPP: Starting MySQL…already running. XAMPP: Starting ProFTPD…ok. and sudo /opt/lampp/lampp stop Stopping XAMPP for Linux 5.6.8-0… XAMPP: Stopping Apache…not running. XAMPP: Stopping MySQL…ok. XAMPP: Stopping ProFTPD…not running. Im try this sudo service mysql stop…
Read more

Order by using selected values from drop down list without using form

Searched many options to find some easy solution where i can sort my results but din’t find any. I want to order the displayed results by selected drop down values. I don’t want to use “form”. Want the other way to sort it. <div class=”col-lg-2″> <label class=”margin-bottom:25px;” style=”margin-left:75px;”> Sort by: <label> </div> <div class=”col-lg-2″> <select class=”form-control” id=”sortby” name=”sortby”> <option selected…
Read more