Jump to content

brown2005

Members
  • Posts

    942
  • Joined

  • Last visited

About brown2005

  • Birthday 03/30/2010

Contact Methods

  • MSN
    richard-brown-2005@hotmail.co.uk

Profile Information

  • Gender
    Male

brown2005's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Need a website developed for a sports pool game I want to run. Needs the following: Members functions Competitions (such as prem league, la liga) Matches & results Leagues (these are created by me for members to enter) Picks (these are the picks of the members) Anyone could do this sort of thing and rough estimate please?
  2. for example they could search rugby and get websites for both rugby league and rugby union, but if they search rugby league only get the rugby league one not the union
  3. What I dont want is for the results to bé Sport Rugby League As when someone searches league I wouldnt want the website to come up. Only when they search rugby leahue i want it coming up
  4. So on my php I would have code to produce; Rugbyleague.com - sport - rugby - rugby league
  5. Domains_id Domains_url Keywords_id Keywords_domain (domains_id) Keywords_word (words_id) Words_id Words_word So domains is for domains I own, then keywords will bé the keywords for those domains, with words being the words that are used for the keyword. So say I have a Rugby League website, the keywords I would associate with this are sport, rugby and rugby league. Domains: 1 rugbyleague.name Keywords 1 1 1 1 1 2 1 1 2 3 (2 and 3 is in keywords_word) (The 2 3 producing rugby league, so some how i would need to get the two words on the php code or would you say use it as 4 rugby league instead of league in words datbase, thus having extra words) Words: 1 Sport 2 Rugby 3 League
  6. Well the keywords are related to the domains, when you search a keyword it will show domains linked with that keyword
  7. I currently have three tables Domains Keywords Words In words I would have Sport Football Rugby And allocate them to the domain in keywords, but say I wanted Rugby League, would I have an entry in words as Rugby League or two seperate entries rugby and league? And how would i combine them in the keywords table? Keywords_id Keywords_domain Keywords_word Thanks
  8. I have used Barand's solution and that works perfectly. Thank you very much
  9. SELECT domains_url, SUBSTRING(domains_url, 1, 1) AS letter FROM a INNER JOIN domains ON a_domain=domains_id ORDER BY letter ASC, domains_url ASC when I use this it will sort like hello-world.co.uk hello-zulu.co.uk hello.co.uk but I am hoping to get the hello first, any ideas please?
  10. I am looking at a website which will have a number of items on it advertised,such as: businesses jobs property etc what I want to know is when designing the database would you have these in one table or a table for each?
  11. function CreateAction($selmgec,$domain,$member,$action){ global $db; $stmt = $db->prepare("INSERT INTO actions(actions_id,actions_selmgec,actions_type,actions_value,actions_member,actions_date,actions_action,actions_number)VALUES('',:field1,1,:field2,:field3,CURDATE(),:field4,0)"); $stmt->execute(array(':field1' => $selmgec,:field2' => $domain,':field3' => $member,':field4' => $action));} if(isset($_SESSION['member'])){ $stmt1 = $db->query("SELECT * FROM actions WHERE actions_selmgec='$_SESSION[selmgec]' AND actions_type='1' AND actions_value='$domain' AND actions_member='$_SESSION[member]' AND actions_action='4' OR actions_action='5' LIMIT 1"); if($stmt1->rowCount() > 0){ }else{ CreateAction($_SESSION['selmgec'],$domain,$_SESSION['member'],$action); } $stmt2 = $db->query("SELECT * FROM actions WHERE actions_selmgec='$_SESSION[selmgec]' AND actions_type='1' AND actions_value='$domain' AND actions_member='$_SESSION[member]' AND actions_action='2' OR actions_action='3' LIMIT 1"); if($stmt2->rowCount() > 0){ }else{ CreateAction($_SESSION['selmgec'],$domain,$_SESSION['member'],$action); } I have the above code, but it inserts the $stmt1 if twice generating two lots of the same data. Any help would be much appreciated
  12. asort($_SESSION['numbers']); print_r(implode(' - ', $_SESSION['numbers'])); well I have that which sorts the numbers in ascending order, but when they are inserted into the database they are in the order they were inserted into the array using array_push($_SESSION['numbers'], $id);
  13. wondering if anyone could help me... $stmt2->execute(array(':field1' => $_SESSION['selmgec'], ':field2' => $_SESSION['member'], ':field3' => $_SESSION['numbers'][0], ':field4' => $_SESSION['numbers'][1], ':field5' => $_SESSION['numbers'][2], ':field6' => $_SESSION['numbers'][3], ':field7' => $_SESSION['numbers'][4], ':field8' => $_SESSION['numbers'][5])); how can I sort the array before inserting in the database?
  14. $_SESSION['selmgec'] = 1; $_SESSION['member'] = 1; if(!isset($_SESSION['numbers'])){ $_SESSION['numbers'] = array(); } if(count($_SESSION['numbers']) > 0){ $stmt = $db->query('SELECT id, url FROM domains d INNER JOIN advertising a ON d.domains_id = a.advertising_value WHERE a.advertising_selmgec = '. $_SESSION['selmgec'] .' AND advertising_type = "1" AND (d.domains_id NOT IN ('. implode(',', $_SESSION['numbers']) .')) ORDER BY RAND() LIMIT 1'); }else{ $stmt = $db->query('SELECT id, url FROM domains d INNER JOIN advertising a ON d.domains_id = a.advertising_value WHERE a.advertising_selmgec = '. $_SESSION['selmgec'] .' AND advertising_type = "1" ORDER BY RAND() LIMIT 1'); } while($row = $stmt->fetch(PDO::FETCH_ASSOC)){ $id = $row['id']; $url = $row['url']; if($stmt->rowCount()>0){ echo' <div id="container">'. $id .' - '.$url.'</div><br />'; }else{ echo' <div id="container">No results exsist. Please edit your filter.</div>'; } array_push($_SESSION['numbers'], $id); asort($_SESSION['numbers']); print_r(implode(' - ', $_SESSION['numbers'])); if(count($_SESSION['numbers']) > 5){ $stmt2 = $db->prepare("INSERT INTO numbers(numbers_id,numbers_selmgec,numbers_member,numbers_date,numbers_one,numbers_two,numbers_three,numbers_four,numbers_five,numbers_six) VALUES('',:field1,:field2,CURRENT_DATE(),:field3,:field4,:field5,:field6,:field7,:field8)"); $stmt2->execute(array(':field1' => $_SESSION['selmgec'], ':field2' => $_SESSION['member'], ':field3' => $_SESSION['numbers'][0], ':field4' => $_SESSION['numbers'][1], ':field5' => $_SESSION['numbers'][2], ':field6' => $_SESSION['numbers'][3], ':field7' => $_SESSION['numbers'][4], ':field8' => $_SESSION['numbers'][5])); unset($_SESSION['numbers']); } } that is my code now, which works the way I want
  15. thanks for the reply. The query needs to be empty at the start, so is there a way I can rewrite the mysql to say like if(count($_SESSION['numbers']) === 0){ }else{ AND (d.id NOT IN ('. implode(',', $_SESSION['numbers']) .')) }
×
×
  • 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.