Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP Select data from diplicated data
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ganpurev
Select data from diplicated data
0 Answer(s)      2 years and a month ago
Posted in : PHP


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'];

}

Advertisement
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
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
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
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
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
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. Please read at http
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 from multiple ResultSets?
Data from multiple ResultSets?  hello, How can I get data from multiple ResultSets?   Hi, You can iterate the ResultSet separately and get the required data. Thanks
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
Insert Data From File
Insert Data From File       Insert Data From File is  used to insert data from file... to insert data from file. To understand this example, we create a table 'Stu_Table
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
data
data  Handling data
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
data
data  data Handling AOP
data
data  Handling data in AOP
data
data handling examples in AOP Model  data handling examples in AOP Model
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
Insert Data From File
Insert Data From File       Insert Data From File is  used to insert data from file... to insert data from file. To understand this example, we create a table 'Stu_Table
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 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
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
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
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
read data from Excel sheet
read data from Excel sheet  Hi, How to read data from an excel sheet using JSP. Thank you
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
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... totalMac_ac1(){ $query1 = "SELECT AVG(MAC) FROM academia1"; $result1
 

 

 

DMCA.com