Jump to content

neo115162

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

neo115162's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Maybe my question is unclear. I am calling two queries, namely; $resNews = $connect->get_query("SELECT id,".strtolower($_GET['lang'])."_heading,".strtolower($_GET['lang'])."_story,DATE_FORMAT(date_ins, '%b %d %Y, %h:%i %p') FROM news WHERE ($partsNews) AND ".strtolower($_GET['lang'])."_heading IS NOT NULL AND publish = 'yes'"); $resEvents = $connect->get_query("SELECT id,".strtolower($_GET['lang'])."_title,".strtolower($_GET['lang'])."_description,DATE_FORMAT(date_ins, '%b %d %Y, %h:%i %p') FROM events WHERE ($partsEvents) AND ".strtolower($_GET['lang'])."_title IS NOT NULL AND event_datum >= NOW() AND publish = 'yes'"); I want to display them seperately, like this; <table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php while (($arrNews=mysql_fetch_array($resNews, MYSQL_NUM))!==FALSE) { ?> <tr> <td><a href="news_details.php?lang=<?php print $_GET['lang'];?>&newsid=<?php print $arrNews[0];?>"><?php print html_entity_decode($arrNews[1]);?></a> [<i><?php print $arrNews[3]; ?></i>]</td> </tr> <tr> <td><?php print limit_characters(html_entity_decode($arrNews[2]),150);?></td> </tr> <?php } mysql_free_result($resNews); ?> <?php while (($arrEvents=mysql_fetch_array($resEvents, MYSQL_NUM))!==FALSE) { ?> <tr> <td><a href="eventdetails.php?lang=<?php print $_GET['lang'];?>&eid=<?php print $arrEvents[0];?>"><?php print html_entity_decode($arrEvents[1]);?></a> [<i><?php print $arrEvents[3]; ?></i>]</td> </tr> <tr> <td><?php print limit_characters(html_entity_decode($arrEvents[2]),150);?></td> </tr> <?php } mysql_free_result($resEvents); ?> </table> I am not getting any results for events, only for news. Can anyone help me?
  2. Hello, I am having problems retrieving results for a particular query which is for events. Every time I type a particular word to search for in the news table I get results and when I do for events it doesn't show. I tried troubleshooting the problem and realized that if I do print mysql_num_rows($resEvents); I will get a result which is more than 0. Can anybody help me with this issue? Thanks in advance.searchresults.php
  3. Hello Psycho, thank you very much for your prompt response. The duplicates are actually the combination of the addressid and personalnumber together that I want to extract. It's actually xml files that has data and the addressid is from a household that has people, each assigned to a personal number. So in the end you may have more than one addressid and personal number but should never have the combination of both. Not from the same file and most definitely not from another file.
  4. Currently I have a PHP code that displays my result as shown here http://www.terranceweb.com/Capture.JPG What I would like to have is for my function to compare the combination of the addressid and personalnumber so that they are unique. If there's any duplicates found then tell me what files are affected with the addressid and personalnumber combination. For example: Files: LabourForceSurvey2013_2012-10-17_11-09-26.xml, LabourForceSurvey2013_2012-10-17_14-33-47.xml, LabourForceSurvey2013_2012-10-17_15-56-10.xml, LabourForceSurvey2013_2012-10-17_16-33-22.xml and LabourForceSurvey2013_2012-10-18_08-14-12.xml has duplicate values with an Address id 1234 and Personal number 1 Files: LabourForceSurvey2013_2012-10-17_11-25-36.xml and LabourForceSurvey2013_2012-10-17_14-53-10.xml has duplicate values with an Address id 4567 and Personal number 1 etc $this->bestandAddrPers[] = array( "bestand" => $file, "addressid" => $addressid, "personalnumber" =>$Q2); private function displayDuplicate($_ARRAY) { foreach ( $_ARRAY as $key => $val ) { foreach ( $_ARRAY as $key2 => $val2 ) { if ( $key == $key2 ) continue; if ( $val['addressid'] == $val2['addressid'] && $val['personalnumber'] == $val2['personalnumber'] ) { // Duplicates are shown here } } } } Much thanks in advance.
  5. Thank you very much guys, I really really appreciate it!
  6. I have a multidimensional array as follows below: $_ARRAY=array( array("a"=>"File1.xml","b"=>1111,"c"=>"1"), array("a"=>"File1.xml","b"=>1111,"c"=>"2"), array("a"=>"File2.xml","b"=>2222,"c"=>"1"), array("a"=>"File2.xml","b"=>2222,"c"=>"1"), array("a"=>"File3.xml","b"=>3333,"c"=>"1"), array("a"=>"File3.xml","b"=>1111,"c"=>"2") ); As you can tell from above there are 2 duplicates (File1.xml B and C combination is the same as File3.xml B and C combination) and I would like to have a check that shows duplicates with the file name that is associated with those duplicates. Any help is greatly appreciated. Much thanks in advance.
  7. Ah man, this works! Thank you so much for helping me out, I really really appreciate it.
  8. Hello somebody, I have a problem with my query... I am trying to display results from one table that is not in the other. Column partner_1 and partner_2 from table couples is linked to user_id on table contestants. Each time I run a query it gives me either double or triple results even results that are in the couples table which shouldn't be. Here are some of the queries I've tried already: SELECT contestants.user_id FROM contestants INNER JOIN couples ON contestants.user_id <> couples.partner_1 AND contestants.user_id <> couples.partner_2 SELECT contestants.user_id FROM contestants,couples WHERE contestants.user_id <> couples.partner_1 AND contestants.user_id <> couples.partner_2 Here is my exported tables: CREATE TABLE contestants ( user_id mediumint( unsigned NOT NULL auto_increment, fname varchar(30) NOT NULL, lname varchar(30) NOT NULL, address tinytext NOT NULL, city tinytext NOT NULL, state varchar(30) NOT NULL, country varchar(26) NOT NULL, email varchar(30) NOT NULL, sex set('M','F') NOT NULL default 'F', DOB date NOT NULL COMMENT 'User''s date of birth (year-month-day)', gebruiker varchar(25) character set latin1 collate latin1_general_cs NOT NULL COMMENT 'Username of the contestant', wachtwoord tinytext character set latin1 collate latin1_general_cs NOT NULL COMMENT 'Password of the contestant', DOR datetime NOT NULL COMMENT 'GMT Date and time of registration', PRIMARY KEY (user_id), UNIQUE KEY gebruiker (gebruiker), UNIQUE KEY email (email) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE couples ( couple_id mediumint( unsigned NOT NULL auto_increment, partner_1 mediumint( unsigned NOT NULL, partner_2 mediumint( unsigned default NULL, PRIMARY KEY (couple_id), KEY partner_1 (partner_1), KEY partner_2 (partner_2) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `couples` ADD CONSTRAINT couples_ibfk_3 FOREIGN KEY (partner_2) REFERENCES contestants (user_id) ON UPDATE CASCADE, ADD CONSTRAINT couples_ibfk_2 FOREIGN KEY (partner_1) REFERENCES contestants (user_id) ON UPDATE CASCADE; Can anybody help me with this problem? Thanks in advance.
×
×
  • 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.