Webmaster Forum

Go Back   Webmaster Forum > Webmaster Discussions > General Webmaster Discussion
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

General Webmaster Discussion General webmaster issues and topics. Search engines, affiliate programs, coding, promotion and more.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2009, 08:20 PM
sasikashiroshi sasikashiroshi is offline
Web Addie Newbie
 
Join Date: Jun 2009
Posts: 3
Default how to SUM output of certain field result

i got 3 combo box for choose driver,vehicleno and month.

OUTPUT
id date driver vehicleno drop

3 2005-06-06 sugu 3411 7
9 2007-01-25 sugu 3411 55
10 2007-01-15 sugu 3411 9
11 0000-00-00 sugu 3411 5


i want to SUM the output of this DROP field result. my coding is below, please someone can help me to find solution for this problem. My coding is below...please advise where to add in the fomula / coding.


index.php

<div align="left">
<p><img src="logo.gif" width="78" height="78">
</p>

<?php

// get variable after selecting something from the dropdown with name 'chooser'
$select = $_POST['select'];

// if something has been chosen
if (!empty($select)) {

// get the chosen value
$chooser = $_POST['chooser'];
$chooser2 = $_POST['chooser2'];
$chooser3 = $_POST['chooser3'];

// do whatever u want with that value
// for example output it
print "<B>Displaying Records for : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Driver $chooser</B><P>";
print "Vehicle No: $chooser2 <br>";
print "Month : $chooser3 <P>";

}

$db="b31_209797_pamross";
$link = mysql_connect("","","");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$result = mysql_query( "select * from dt_tb where driver='$chooser' and vehicleno='$chooser2' and month(startdate) between '$chooser3' and '$chooser3' " )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<P>";
print "<table width=800 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td><font face=arial size=1/>$field</font></td>\n";
print "</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>
__________________
education software I Heart surgery
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Safari 4 launch - interesting result mady Domain Names Discussions 0 06-13-2009 07:24 AM
Safari 4 launch - interesting result mady Domain Names Discussions 0 06-13-2009 07:18 AM
Pure amateur hardcore, teen amateur chubby ****, tulsa amateur radio field day top1 General Webmaster Discussion 0 02-07-2009 11:27 PM
Fresh and Hot Content- Everything and More - Haulsiptflils General Webmaster Discussion 0 04-29-2008 02:00 AM
A field requiring expertise Yvonne69 General Webmaster Discussion 0 01-22-2008 04:10 AM

Sponsor Ads:


Free Trial Remote PC Access Software


All times are GMT -5. The time now is 05:18 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC6
vB.Sponsors 1.0.4
Site Content - Copyright © 2000-2006 - ePressive LLC