
shahzad429
Members-
Posts
42 -
Joined
-
Last visited
Everything posted by shahzad429
-
I have two tables CREATE TABLE `pricedata` ( `TableID` int(11) NOT NULL AUTO_INCREMENT, `AgentName` int(10) DEFAULT NULL, `VechicleName` int(10) DEFAULT NULL, `DestinationName` int(10) DEFAULT NULL, `FromDA` float DEFAULT '0', `FromAA` float DEFAULT '0', `FromSA` float DEFAULT '0', `FromRA` float DEFAULT '0', `UserID` int(10) DEFAULT NULL, PRIMARY KEY (`TableID`) ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=latin1; CREATE TABLE `vehicles` ( `TableID` int(11) NOT NULL AUTO_INCREMENT, `VechicleName` varchar(255) DEFAULT NULL, `VehiclesTypeName` int(10) DEFAULT NULL, `MoreInfo` longblob, `Pic1` varchar(255) DEFAULT NULL, `Facilities` varchar(1000) DEFAULT NULL, `MaxPass` varchar(255) DEFAULT NULL, `MaxSuit` varchar(255) DEFAULT NULL, `GolfBag` varchar(255) DEFAULT NULL, `ExtraBag` varchar(255) DEFAULT NULL, `ChildBooster` varchar(255) DEFAULT NULL, `InfantSeat` varchar(255) DEFAULT NULL, `WheelChair` varchar(255) DEFAULT NULL, `Bicycle` varchar(255) DEFAULT NULL, `ExtraStop` varchar(255) DEFAULT NULL, `UserID` int(10) DEFAULT NULL, PRIMARY KEY (`TableID`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; what i am doing right now is using below query "select * from pricedata where DestinationName='1' group by AgentName ,VechicleName" but now i am stuck because now clients wants to show result based on VehiclesTypeName which is in my second table. so how i can display the result where DestinationName=1, VehiclesTypeName=3 and MaxPass<=4? maybe we can do it my mysql join or left or right join i am weak in mysql if anyone can help me please. Thanks, Shahzad
-
Ok round() is fine. and how can i show days with no data??
-
Thanks Barand it is working fine. It is showing the days with the data can we make it in a way that it will display all days in that month if no data then it will show 0 and 1 more question sum and average are showing 8-9 digits after decimal. we have to put some thing in query so that it will only display 2 or 3 digit after decimal?? Thanks again for your help. Thanks, Shahzad
-
I have a table CREATE TABLE `safarioldddata` ( `TableID` int(11) NOT NULL AUTO_INCREMENT, `TourDate` date DEFAULT NULL, `ClientName` varchar(255) DEFAULT NULL, `NOAdults` int(10) DEFAULT '0', `AdultAmount` float DEFAULT '0', `AdultAvg` float DEFAULT '0', `NOChildren` int(10) DEFAULT '0', `ChildrenAmount` float DEFAULT '0', `ChildAvg` float DEFAULT '0', `UserID` int(10) DEFAULT NULL, PRIMARY KEY (`TableID`) ) And now i am working on daily report i have used below query select TourDate,sum(NOAdults) as NOAdult , sum(AdultAmount) as AdultTotal, avg(AdultAvg) as AdultAVG, sum(NOChildren) as NOChildren , sum(ChildrenAmount) as ChilrenTotal, avg(ChildAvg) as ChildrenAVG from safarioldddata where TourDate="2012/1/2" it is working fine but the problem is as i am passing one days it give me on record like TourDate NOAdult AdultTotal AdultAVG NOChildren ChilrenTotal ChildrenAVG 1/2/2012 183.00 34,253.38 206.24 24.00 1,966.60 36.36 there is a way where i will pass month and year and it will display report for whole that month. Thanks, Shahzad
-
Compare Mysql Table And Display Which Not Exist
shahzad429 replied to shahzad429's topic in PHP Coding Help
select * from product where TableID not in (select ProductID from agencytoproduct where AgencyID='$object[TableID]') order by ProductName asc i have used this and it worked is it ok?? -
I have two table 1. TableID, ProductName 2. TableID, AgencyID, ProductID what i want to do is to display all the products from table 1 and exclude when TableID of table 1 match ProductID of table 2. any help regarding this pelase Thanks, Shahzad
-
Store Values From Add & Remove Select Lists
shahzad429 replied to shahzad429's topic in Javascript Help
Thank you it worked thank you very much for you help. -
Store Values From Add & Remove Select Lists
shahzad429 replied to shahzad429's topic in Javascript Help
the goal is what ever user select to store those options in DB for later retrieval. so what ever method is good tell me. right now in front end user can add and remove option but what i want when he submit i should know when he select so that i can save them. Thanks, shahzad -
Store Values From Add & Remove Select Lists
shahzad429 replied to shahzad429's topic in Javascript Help
I know but no help from javascript section so i thought maybe some one from PHP area know how to take this value and store them in database. thanks is why i post this here. Sorry -
I have use this This to make add/remove select list <form action="home.php?action=test" method="post" id="myform" name="myform" onsubmit="ValidatePageForm()"> <fieldset> <select name="selectfrom" id="select-from" multiple size="5"> <option value="1">Item 1</option> <option value="2">Item 2</option> <option value="3">Item 3</option> <option value="4">Item 4</option> </select> <a href="Javascript:void(0);" id="btn-add">Add »</a> <a href="Javascript:void(0);" id="btn-remove">« Remove</a> <select name="selectto" id="select-to" multiple size="5"> <option value="5">Item 5</option> <option value="6">Item 6</option> <option value="7">Item 7</option> </select> </fieldset> <input name="submit" type="submit" value="submit" /> </form> using below script i can see values of selected options <script type="text/javascript"> function ValidatePageForm() { $('#select-to option').each(function(){ alert($(this).val()); }); } </script> But how can i take these values and store them in database?? because when i submit i dont get see data in post dump. any help regarding this please. Thanks, Shahzad
-
I have Google map using Google map API v3. what i have is a Google map in accordion which user can click and place a marker and value of lat & lon fill two text boxes on top. this part is working fine with below script. but what i want now as text boxes is filled with lat & lon if user change value of lat or lon in text box marker need to change accordingly. var map = null; function initialize() { var myLatlng = new google.maps.LatLng(25.263327,55.329895); var myOptions = { zoom: 10, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var marker; function placeMarker(location) { if ( marker ) { marker.setPosition(location); } else { marker = new google.maps.Marker({ position: location, map: map }); } } google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); document.getElementById("latFld").value = event.latLng.lat(); document.getElementById("lngFld").value = event.latLng.lng(); }); } $(document).ready(function() { $("#accordion").bind('accordionchange', function(event, ui) { if (ui.newContent.attr('id') == 'tabThree' && !map) { map = initialize(); } }); });
-
How to check first 2 letter of string is capital or not
shahzad429 replied to shahzad429's topic in PHP Coding Help
thanks Pikachu2000 it is working like a charm thank you again every one for all your help and support. -
How to check first 2 letter of string is capital or not
shahzad429 replied to shahzad429's topic in PHP Coding Help
thank you very much guys. -
How to check first 2 letter of string is capital or not
shahzad429 posted a topic in PHP Coding Help
I have a 5 letter string eg: etd00 and AA001 there is any way in PHP to check first 2 letters are capital or not? Thanks, Shahzad -
yes i can control so how to format a string?
-
Hey I have a string eg 201106 which i want to display like June 2011 how can i do it?? Thanks in advance
-
Barand I have added DATE_SUB(CURDATE(),INTERVAL 1 year) <= l.accessdate in my months query so that it display months and clicks per month for last year. it is displaying from 1 to 12 as it is May 2012 now so how can i display records from May 2011 to May 2012?? SELECT m.month, COUNT(l.accessdate) as total FROM tempmonths m LEFT JOIN log l ON m.month = MONTH(l.accessdate) AND l.linkcode = 'dcxha' and DATE_SUB(CURDATE(),INTERVAL 1 year) <= l.accessdate GROUP BY m.month
-
nice thanks alot for this effort yes later this database is going to have data for more that 2 years thanks to save me ..
-
Thanks bro it is working
-
so where in this query i can write SELECT LAST_DAY(l.AccessDate) and i have to remove 31 from temporary table right??
-
barand today i am working on daily report so query i wrote with dummy table is select d.days as Day, count(l.AccessDate) as Total from tempdays d left join log l on d.days=day(l.AccessDate) and l.linkcode='dcxha' and month(l.AccessDate)=4 group by d.days it is displaying date 0 to 31 with clicks working fine but as i have passed month=4 so april have 30 days so there is any way so that code know how many days to show in each month thanks, Shahzad
-
working like a charm thanks again
-
One last question barand where in below query i can write where LinkCode='dcxha' SELECT m.month, COUNT(l.accessdate) as total FROM tempmonths m LEFT JOIN log l ON m.month = MONTH(l.accessdate) GROUP BY m.month as my query before this left join was SELECT month(accessdate) as Month, COUNT(*) as Total FROM log where LinkCode='dcxha' GROUP BY Month as i want to show count for particular LinkCode Thanks again bro you save my life today by helping me this much
-
thank-you very much it is working perfectly now.
-
Thanks bro it is working now. i used below query SELECT month(accessdate) as Month, COUNT(*) as Total FROM log where LinkCode='dcxha' GROUP BY Month and result is good i can see Month | Total 4 125 5 87 but now i am thinking to show even those month on which clicks are 0 like is it possible?? Month | Total 1 0 2 0 3 0 4 125 5 87 6 0 7 0 8 0 9 0 10 0 11 0 12 0