Select data from diplicated data

Select data from diplicated data

hello i have table

  • location duration
  • msce 18:00
  • smc 13:00
  • msce 5:00

i need to get msce 23:00 how go get like this?

the code is

if(isset($_GET["id"]))
    {
        $id= $_GET["id"];}

    if(isset($_GET["is"]))
    {
        $is= $_GET["is"];}


    $user_name = "root";
    $password = "";
    $database = "test";
    $server = "127.0.0.1";

$db_handle = mysql_connect($server, $user_name, $password);

$db_found = mysql_select_db($database, $db_handle);

if ($db_found) {


$SQL = "SELECT location FROM (".$is.")  WHERE sub_cat=('".$id."')";
$result = mysql_query($SQL);

 $scs_count='0';
$cs="0";
$location=array();
while ($db_field = mysql_fetch_array($result)) {
$location_c[$cs]= $db_field['location'];

$cs++;
$scs_count++;
}

$duration_c=array();
$cks="0";
for($k=0;$k<$cs;$k++)
{ 

$SQL = "SELECT duration FROM core_network WHERE location=('".$location_c[$k]."')";
$result = mysql_query($SQL);

$db_field = mysql_fetch_array($result);
$duration_c[$k]= $db_field['duration'];

}
View Answers









Related Tutorials/Questions & Answers:
Select data from diplicated data
Select data from diplicated data  hello i have table location...++) { $SQL = "SELECT duration FROM core_network WHERE location=('".$location_c[$k... = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "SELECT
Select data from Table in Database
Select data from Table in Database   ... the selected data from table in database. The select query in the database retrieve...; in simple select statement is given below select column name from table;ADS
Advertisements
Select tag to fetch data from oracle database
Select tag to fetch data from oracle database  I created a select box having more than one menus in the select box such as regnno, address and name of a student and when regnno is selected from the drop down list by a user
Select Employee and display data from access database in a jtable
Select Employee and display data from access database in a jtable  I there Iam a java beginner. I have to create a application where I can select a employee's name from a comboBox and the jtable will be filled with all
Use of Select Box to show the data from database
Use of Select Box to show the data from database       Example program using Select Box to show retrieved data from database This example will describe you the use of Select Box in a JSP
Proplem with select data - Struts
Proplem with select data  Hi , Please can u give me a example for display all data from the database (Access or MySql) using Struts
selecting data from database
selecting data from database  how to select data from database using Dao in struts   Hi, You have to load the data from database using hibernate and send the data in a Java file object to jsp page.ADS_TO_REPLACE_1
extract data from HTML
extract data from HTML  how to write the coding for to extract data from html tags like(h3,p) and then extracted data should be stored in data base? can anybody tell me how to write the coding
data science from iim
data science from iim  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data science from... the topic "data science from iim". Also tell me which is the good
data analytics from iim
data analytics from iim  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data analytics... the topic "data analytics from iim". Also tell me which is the good
Data from multiple ResultSets?
Data from multiple ResultSets?  hello, How can I get data from multiple ResultSets?   Hi,ADS_TO_REPLACE_1 You can iterate the ResultSet separately and get the required data. Thanks
Retrieve The Data From MySql Datbase
Retrieve The Data From MySql Datbase   How to Retrieve The Data From MYSQL database TO Use Select the Emp_id Option.And Also Search Option
Insert Data From File
Insert Data From File       Insert Data From File is  used to insert data from file... an example to insert data from file. To understand this example, we create
retrive data from database
retrive data from database   hi.. i made a application form. it's have attribute s.no,name,roll no and i enter a few records. now i want to view all record not in database access sheet i want to view it at any another
retrive data from database?
retrive data from database?  hellow i have a database sheet name as db1. it's contain sixty(60) sn,name ,rollno(primary key),father's name etc... from db1 and enter value in text box according there name,rollno and save
To retrive data from database - Struts
To retrive data from database  How to get values ,when i select a select box in jsp and has to get values in textbox automatically from database? eg:I have three tables in database,and in jsp page if i select courseid in select
parse data from a link in java
parse data from a link in java  Hi, Here I want code for Extracting data from a link and the data a must be stored in mysql and then I need to display the data in a jsp page
fetch data from database in javascript
fetch data from database in javascript   How to fetch data from database in JavaScript when it is a leap year
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to fetch data from servlet ????
how to fetch data from servlet ????  how to fetch data from servlet
Getting data from servlet into javascript
Getting data from servlet into javascript  How do i get json data from my servlet on to a variable in javascript n bind the data to display onto sigma grid.Has anyone Idea how to do
Insert Data From File
Insert Data From File       Insert Data From File is  used to insert data from file... an example to insert data from file. To understand this example, we create
data science course from iit
data science course from iit  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data... can learn the topic "data science course from iit". Also tell me
learn data science from scratch
learn data science from scratch  Hi, I am beginner in Data Science... data science from scratch Try to provide me good examples or tutorials links so that I can learn the topic "learn data science from scratch". Also
data science jobs from home
data science jobs from home  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data... can learn the topic "data science jobs from home". Also tell me which
data science course from iim
data science course from iim  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data... can learn the topic "data science course from iim". Also tell me
read data from Excel sheet
read data from Excel sheet  Hi, How to read data from an excel sheet using JSP. Thank you
how to retrieve data from database
how to retrieve data from database  unable to retrieve data from database using mySQL by using jsp sessions and beans for editing
FAILED TO INSERT DATA FROM FUNCTION();
FAILED TO INSERT DATA FROM FUNCTION();  HELLO, I HAVE A PROBLEM TO INSERT DATA FROM OUTPUT FROM FUNCTION()... I WANT TO STORE THE OUTPUT IN DATABASE...(){ $query1 = "SELECT AVG(MAC) FROM academia1"; $result1 = mysqlquery($query1
Data extraction from an image file.
Data extraction from an image file.  I have made an image... data from the the image which also include deleted data.Can i used java to extract these data from the image file? Which are the libraries to be used
retrieve data from mysql database
retrieve data from mysql database  hi am not familiar in php.....even... selected value on combobox which is to be retrieve the relevant data from mysql...;method="post"> <select id="inputfield" name="term" size="1"> <
Purge Data from Mysql tables
Purge Data from Mysql tables  Hi, i have to write a mysql procedure to purge data from tables. but written procedure clear entire tables data...; DELETE FROM conference_table WHERE confrefno= confRefNo; SELECT COUNT(listid
store data from a variable in mysql?
store data from a variable in mysql?  sir last time asked you tell me how to retrieve data from a database mysql and store it in an int variable...=conn.createStatement(); ResultSet rs=st.executeQuery("select * from numbers
delete data from database - SQL
delete data from database  HOw to delete specific data from table> I want to delete one record from database. Thnx  Hi friend, -------------------------------------------- Visit for more information
How to select Data Between Two dates in Java, MySQL
How to select Data Between Two dates in Java, MySQL  How to select Data Between Two dates in Java, MySQL? Thanks in advance.   http://www.v7n.com/forums/coding-forum/294668-how-select-data-between-two-dates-php
How you will Show all data from a table.
How you will Show all data from a table.   How you will Show all data from a table.   Hi, following query is used to show all the data of the table-ADS_TO_REPLACE_1 SELECT * FROM tablename; Thanks
How to delete data from MySQL?
How to delete data from MySQL?  Hi, How I can conditionally delete the data from MySQL Table? Thanks   Hi, You can use the where clause to conditionally delete the data from MySQL database table. Here is some query
retreiving data from microsoft access database
retreiving data from microsoft access database  How can i retrieve data from microsoft access when i have select the vaules in combo box and text box. When i select these values... i want to retrieve the corresponding columns
Problem in accessing data from Database
Problem in accessing data from Database  hi..... i'm making a project... is text and all others are of currency data type. If i enter 0 or null value in currency column and then try to retrieve data using my servlet coding
data
data  Handling data
retrive data from oracle to jsp
retrive data from oracle to jsp  i am a beginer in jsp so please help...(); psmt= conn.prepareStatement("select * from CR_EMPLOYEE_DETAILS... cost and manager name and storing it in the data base. in search proj fiel
Data retrieve from mysql database
Data retrieve from mysql database  Hi sir, please give some example... from the dropdown, related data will get displayed on the textboxes. Here we have... = DriverManager.getConnection(url+dbName,userName,password); String query = "select * from
retreive integer data from database
retreive integer data from database  i made a table named result...=lalit&database=mydb"); String url="select marks from student where rollno... and two buttons "ok" and "cancel" i want to take input from textfield
Getting Textbox data from database
Getting Textbox data from database  When i m trying to get data...=stmt.executeQuery("select fname,empid from cremp where empid='"+empid... data from database and display it on the textboxes. <%@page language="java
Retrive the data from the table in data base using jdbc
Retrive the data from the table in data base using jdbc  Retrive the data from the table in data base using jdbc   JDBC Tutorials
data
data  data Handling AOP
data
data  Handling data in AOP

Ads