Jump to content

desibhupi

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

desibhupi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I got it fixed with the following code: $sql = "select "; $sql .= "custmer_details.company_name, "; $sql .= "outbound.challan_no, "; $sql .= "outbound.quantity, "; $sql .= "outbound.total_amount, "; $sql .= "outbound.date, "; $sql .= "collection.amount, "; $sql .= "collection.created_date, "; $sql .= "collection.process, "; $sql .= "inbound.entry_id "; $sql .= "from "; $sql .= "((custmer_details inner join outbound on custmer_details.custmer_id=outbound.customer_id) "; $sql .= "inner join collection on custmer_details.custmer_id=collection.company_id) "; $sql .= "inner join inbound on custmer_details.custmer_id=inbound.custID $where $f_qry $c_qry $p_qry "; $sql .= "group by collection.collection_id"; Thanks for your quick response. Regards, Bhupinder
  2. $from = $_POST[from]; $to = $_POST[to]; $cid = $_POST[cid]; $process = $_POST[process]; if($from != "" || $to !="" || $cid!="" || $process!="") { $where = ' where '; } if($from != "") { $f_qry = "collection.created_date>='".$from."' "; } if($to != "") { $f_qry = "date(collection.created_date) between '".$from."' and '".$to."'"; } if($cid != "") { if($f_qry || $t_qry) { $c_qry = ' and '; } $c_qry .= "outbound.customer_id='$cid'"; } if($process != "") { if($f_qry || $t_qry || $c_qry) { $p_qry = ' and '; } $p_qry .= "collection.process='$process'"; } if($f_qry || $t_qry || $c_qry || $p_qry) { $sub_qry = ' and '; } $sub_qry .= " (cust.custmer_id=coll.company_id) "; $sql = "select "; $sql .= "custmer_details.company_name, "; $sql .= "outbound.challan_no, "; $sql .= "outbound.quantity, "; $sql .= "outbound.total_amount, "; $sql .= "outbound.date, "; $sql .= "collection.amount, "; $sql .= "collection.created_date, "; $sql .= "collection.process, "; $sql .= "inbound.entry_id "; $sql .= "from "; $sql .= "((custmer_details inner join outbound on custmer_details.custmer_id=outbound.customer_id) "; $sql .= "inner join collection on custmer_details.custmer_id=outbound.customer_id) "; $sql .= "inner join inbound on custmer_details.custmer_id=outbound.customer_id $where $f_qry $c_qry $p_qry"; $qry = mysql_query($sql) or $content = mysql_error().'<br />'.$sql; if(mysql_num_rows($qry) > 0 ) { $content .= ' <table width="100%" cellpadding="0" cellspacing="0"> <tr bgcolor="#d2d2d2"> <th>Company</th> <th>Ch#</th> <th>Qty.</th> <th>O/B Amt.</th> <th>Date</th> <th>Process</th> <th>Collection</th> </tr> '; while($d = mysql_fetch_object($qry)) { $custName = $d->company_name; $obCh = $d->challan_no; $obQty = $d->quantity; $obAmt = $d->total_amount; $obDate = $d->date; $ibProcess = $d->process; $collAmt = $d->amount; $collDate = $d->created_date; $collProcess = $d->collProcess; $process = $ibProcess!="" ? $ibProcess : $collProcess ; $date = $obDate!="" ? $obDate : $collDate; $content .= ' <tr> <td>'.$custName.'</td> <td>'.$obCh.'</td> <td>'.$obQty.'</td> <td>'.$obAmt.'</td> <td>'.$date.'</td> <td>'.$process.'</td> <td>'.$collAmt.'</td> </tr> '; } $content .= '</table>'; // $content = $sql; } else { $content .= 'No record to display.'; } it results with 8 duplicate rows: I know the problem is with SQL Syntax. Is there any other method to solve this problem. Please help Regards, Bhupinder
  3. I found the other way Thanks for your support
  4. I want to show the Program Name that also exists (PID) in 'repetitive_program' but there is difference between their timings.
  5. Hello friends, I m making a TV Schedule Script. I have a case that a program is repeating on the same day. I m using the following code but it is showing that record only once. please help $sql = "select program.*, repetitive_program.* from program, repetitive_program where "; $sql .= "(program.weekday like '%$day%' and program.repeat='w') or "; $sql .= "(program.weekday like '%$day%' and program.repeat='a' and program.alt_repeat='$week') or "; $sql .= "(program.repeat='n' and program.special_date='$date')or "; $sql .= "(repetitive_program.pid = program.pid and repetitive_program.r_timing != program.timing) "; $sql .= " order by program.timing, repetitive_program.r_timing"; below is the schema for these two tables. -- -- Table structure for table `program` -- CREATE TABLE `program` ( `pid` int(9) NOT NULL auto_increment, `cid` int(6) NOT NULL, `title` varchar(255) collate latin1_general_ci NOT NULL, `description` text collate latin1_general_ci NOT NULL, `image` varchar(255) collate latin1_general_ci NOT NULL, `clip` varchar(255) collate latin1_general_ci NOT NULL, `cast` text collate latin1_general_ci NOT NULL, `director` text collate latin1_general_ci NOT NULL, `producer` text collate latin1_general_ci NOT NULL, `weekday` varchar(255) collate latin1_general_ci NOT NULL, `timing` time default NULL, `alt_repeat` enum('e','o') collate latin1_general_ci default NULL, `repeat` enum('w','a','n') collate latin1_general_ci NOT NULL default 'w', `special_date` date default NULL, `completed` enum('y','n') collate latin1_general_ci NOT NULL default 'y', PRIMARY KEY (`pid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=21 ; -- -- Dumping data for table `program` -- INSERT INTO `program` VALUES (10, 3, 'Comedy Show 2', 'fdf', '', '', '', '', '', 'Monday,Wednesday,Saturday', '00:30:00', NULL, 'w', NULL, 'y'); INSERT INTO `program` VALUES (11, 5, 'Jap Mann Satnam', 'Shabad Kirtan', '', '', '', '', '', 'Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday', '04:00:00', NULL, 'w', NULL, 'y'); INSERT INTO `program` VALUES (12, 12, 'Games Competitions', 'Punjabi Khedaan', '', '', '', '', '', 'Monday', '16:30:00', 'o', 'a', '2007-05-27', 'y'); INSERT INTO `program` VALUES (16, 3, 'Movie Masala', 'bollywood', '', '', '', '', '', 'Tuesday', '22:30:00', '', 'w', '0000-00-00', 'y'); INSERT INTO `program` VALUES (15, 12, 'News show', 'compete', '', '', '', '', '', 'Monday', '12:30:00', 'e', 'a', '2007-05-20', 'y'); INSERT INTO `program` VALUES (17, 5, 'Talk Show', 'sdfdsvcxvdd', '', '', '', '', '', 'Sunday', '13:00:00', 'e', 'a', '2007-05-20', 'y'); INSERT INTO `program` VALUES (19, 2, 'Serialzz', '', '', '', '', '', '', '', '13:30:00', '', 'n', '2007-05-28', 'y'); INSERT INTO `program` VALUES (20, 10, 'India Rupee', 'kk', '', '', '', '', '', '', '22:30:00', '', 'n', '2007-05-28', 'y'); -- -------------------------------------------------------- -- -- Table structure for table `repetitive_program` -- CREATE TABLE `repetitive_program` ( `rid` int(4) unsigned NOT NULL auto_increment, `pid` int(4) NOT NULL, `weekday` varchar(225) collate latin1_general_ci NOT NULL, `r_timing` time NOT NULL, PRIMARY KEY (`rid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `repetitive_program` -- INSERT INTO `repetitive_program` VALUES (1, 10, 'Monday,Wednesday,Saturday', '19:06:00');
  6. I m not in trouble with DIV IDs. well i have found the solution btw. thanx you both for your support.
  7. I have made an Image Gallery with PHP/MySQL working fine. On the Gallery page i m showing Thumbnails, say, of 150x150. Now what i want to do is, When Visitor place his mouse over the image (which is set in a DIV without having ID, means its relative) Another div should be displaying the large Image under that DIV. for reference i just need some functionality as Template Monster has , how can i do that. its very critical. please help Thanks Bhupinder
  8. I have made a javascript that opens a picture in Div (absolute positions mentioned in css) I want to show this image in this specific div but exactly in the center (horizontally and vertically) of the bowser screen. Can anybody help in this regards, Thanx in advance Bhupinder
  9. Thanks, i feel it will resolve the issue that made my head aching Thanx again. Bhupinder
  10. lol I know that but i want to do something with PHP so that the application may become platform indenpendant. Bhupinder
  11. I want to make a script to notify my registered member before exactly 1day/week/month before their membership expires. Means an auto run PHP script that checks the expiry date and send MAIL to members whose membership is expiring within x number of days/week/month. I know it can be done with Cron Jobs on Linux but i need something that can work on Windows too. Thanx
  12. Okay guys thanks u all for instant support. I've decided to use hidden values as i don't want to use sessions and cookies. Bhupinder
  13. [quote author=twilightnights link=topic=124837.msg517847#msg517847 date=1170228109] You could parse the stuff on the end of the URL and use the get function, I'm not sure if there is a limit to that though. That is what I do on part of my site, for example http://www.omgjokes.com/random.php?i=20 You use $_GET to grab the value of I and you can use multiple values. [/quote] I can't use $_GET method to fetch the values for security reasons. [quote author=chronister link=topic=124837.msg517849#msg517849 date=1170228429] There is a limit as to how long a url string can be, although I cannot remember offhand. I personally would use session vars for this kind of thing rather than messing with hidden form fields. [quote] hmmm yeah, i know. But I m getting 'Page not found' (PS : its not 'Page expired' like thing) error. [/quote] If it a 404 Page Not Found, then the page don't exist (I mean in the path provided in the url) That's my 1.5 cents [/quote] I m posting the form on the same page for a number of times. so why m i getting this error while pressing Browser's Back button
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.