ayesha789 7

Its solved
[CODE]Select site,Expense from
(
Select 'Expense' AS Category,Site,Sum(Category_Total) as Expense from
(
(
SELECT 'Diesel' AS Category,Code as Site,ROUND(SUM(Qty Itemrate)) AS Category_Total
FROM diesel_info
INNER JOIN rates ON diesel_info.marker = rates.item
AND MONTH( diesel_info.Date ) = MONTH( rates.Date ) Group by Site
)
UNION ALL
(
SELECT 'Lims Payment' AS Category, Code AS Site, ROUND( SUM( Amount /12 ) ) AS Category_Total
FROM lims_payment
GROUP BY Site
)
UNION ALL
(
SELECT 'Electricity' AS Category,Site,electotal AS Category_Total from
((SELECT Code as Site,SUM(GrossAmountWD) as electotal FROM eims_north Group by Code) UNION ALL (SELECT Code as Site,SUM(GrossAmountWD) as electotal FROM eims_center Group by Code) UNION ALL (SELECT Code as Site,SUM(GrossAmountWD) as electotal FROM eims_south Group by Code)) as eletbl group by Site
)
UNION ALL
(SELECT 'Security' AS Category, SiteID AS Site, SUM( Rates.ItemRate ) AS Category_Total
FROM securityguards
INNER JOIN rates ON securityguards.Company = rates.item
GROUP BY Site)
UNION ALL
(SELECT 'Outsourcing' AS Category, Code AS Site, SUM( Rates.ItemRate ) AS Category_Total
FROM info
INNER JOIN rates ON info.MaintainedBy = rates.item
GROUP BY Site)) as tbl group by Site
) as tbl2 WHERE Expense=(Select Max(Expense) from
(
Select 'Expense' AS Category,Site,Sum(Category_Total) as Expense from
(
(
SELECT 'Diesel' AS Category,Code as Site,ROUND(SUM(Qty
Itemrate)) AS Category_Total
FROM diesel_info
INNER JOIN rates ON diesel_info.marker = rates.item
AND MONTH( diesel_info.Date ) = MONTH( rates.Date ) Group by Site
)
UNION ALL
(
SELECT 'Lims Payment' AS Category, Code AS Site, ROUND( SUM( Amount /12 ) ) AS Category_Total
FROM lims_payment ...

ayesha789 7

[QUOTE=urtrivedi;1243966]you need to enable php_curl.dll extention[/QUOTE]
But I dont know how to enable, I am using XAMPP and in PHP Manual they said put Curl files in Libcurl....confused

musthafa.aj commented: useful post +1

ayesha789 7 Posting Pro in Training

Dears
[INDENT]This is an electricity billing Site link [url]http://www.mepco.com.pk/ls/defftree.asp[/url][/INDENT]
I click on each link and SELECT and COPY/PASTE , It takes 3 hours minimum each day to save all pages in Excel.
I want to get all pages automatically using PHP or Query.
Because higher management demand reports each day.

urtrivedi commented: very enthusiastic and a good learner +2

ayesha789 7 Posting Pro in Training

I have Developed a Database using MySQL and PHP.
Now there are 60+ users who are using this DB.
I want to make a system which tells me about Active and inactive users.
Please guide me.
My memebers table is like
[CODE=mysql]--
-- Table structure for table members

CREATE TABLE IF NOT EXISTS members (
MemId int(5) NOT NULL AUTO_INCREMENT,
UserName varchar(25) NOT NULL,
Password varchar(20) NOT NULL,
Type varchar(20) NOT NULL,
PRIMARY KEY (MemId)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=61 ;
[/CODE]

My checklogin.php page
[CODE=php]<?php
ob_start();
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="onm"; // Database name
$tbl_name="members"; // Table name

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

// Define $myusername and $mypassword
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];

// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);

$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);

// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row

if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
header("location:sims_login_error.php");
}

ob_end_flush();
?>

[/CODE]

and my loginsuccess.php page
[CODE=php]
<?
session_start();
if(!session_is_registered(myusername)){
header("location:onm.php");
}
?>
<?
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="onm"; // Database name
$tbl_name="members"; // Table name

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select ...

ayesha789 7

[QUOTE] following code may help you [/QUOTE]
[CODE]
'da is your dataadapter through you fill dataset
'ds is your dataset

dim cmb as new commandbuilder(da) 'initialize commandbuilder
da.update(ds,"tablename")

' keep in mind the primary key is essential for update
[/CODE]

ayesha789 7

I tried but did not found any form in google.
I need logic behind this. I will do coding myself.
Please help me out.

ayesha789 7

Please visit this website you will get many tutorials related to web mail function and attachments.

[URL="http://tutorialized.com"]http://tutorialized.com[/URL]

Thanks
Ayesha

gingank commented: thank you it useful +1