Jump to content

bendurber

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bendurber's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I am running php on a sambar server and have been successfully for a while now. I have spent all day trying to install CURL to no avail and was wondering if someone could help. I can see in my extensions folder that I have php_curl.dll, I went to my php.ini file (the location that the php_info() outputs) and couldn't find the extension so I created it (extension=php_curl.dll). When I then restart the server and load the php_info again there is no mention of curl. Any ideas?
  2. id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE r ref search_id,result_link search_id 5 const 42672 Using where 1 SIMPLE c ref comp_id comp_id 5 db_hr.r.result_link 2 Using where Once I ran this query it took around 2.5 seconds and that is to align all of the companies with contacts. Given the previous results its excellent and I suspect I cant really do much more to improve it? Thanks for you help
  3. I can and will change the company id field to an Indexed field. The database is already set to MyISAM. Is the query that I am using the best way or is there a more efficient way? Thanks
  4. Hi, I need to optimise a query due to the size of the tables. To set the background I have three tables tbl_company(30k records), tbl_contact(50k records) and tbl_search_results(1M+ records). A company may have many contacts and the table is joined by the field comp_id. I have a list of companies in the search table and want to get all of the contacts associated to those companies. The query below works fine for when the number of records in the search is small but it takes a lot longer when we increase it to 1000, 10000 and all of the companies (30000). SELECT * FROM tbl_search_results r INNER JOIN tbl_contact c ON r.result_link = c.comp_id /*(note, the company id is not the primary key)*/ WHERE search_id='590'; Any ideas as to how I can improve the efficiency would be most appreciated. Thanks Ben
  5. On a table of 15000 it took around 0.6 seconds without any indexing. I like the idea of using surname <= 'bloggs' LIMIT 10 however this would be difficult when we are a few pages back as the only reference point I would have is 'bloggs'. Your solutions solves that because I can do: WHERE d1.rank BETWEEN (d2.rank - 300) AND (d2.rank - 260). In fact I could do: SELECT d1.cand_name_fo, d1.cand_name_ln, d1.cand_id, d1.rank FROM ( SELECT cand_id, cand_name_fo,cand_name_ln,(@rnk1 := @rnk1+1) as 'rank' FROM tbl_cand p JOIN (SELECT @rnk1 := 0) x ORDER BY p.cand_name_ln ASC, p.cand_name_fo ASC ) d1 JOIN ( SELECT * FROM ( SELECT cand_name_fo,cand_name_ln,(@rnk2 := @rnk2+1) as 'rank' FROM tbl_cand p JOIN (SELECT @rnk2 := 0) x ORDER BY p.cand_name_ln ASC, p.cand_name_fo ASC ) x WHERE cand_name_ln >= 'bloggs' LIMIT 1 ) d2 WHERE d1.rank BETWEEN (d2.rank - 3) AND (d2.rank + 3) ORDER BY d1.rank; Changing the WHERE statement to just look at the surname but the problem is if we have 100 'Smith' and we are looking for 'zoe' 'smith' it wouldn't show her on the first page where we want it.
  6. That works well thanks. The first part of the JOIN (d1) gets all of the records in order of surname, forename (note you need to change the first line to d1.surname not d2.surname) Then the second part (d2) finds the rank value of the 'joe' 'bloggs' (it is worth while putting a 'LIMIT 1' at the end in case you have duplicate records) Finally it searches for records between the ranked value in d2. However it only works if the person 'joe' 'bloggs' is in the database exactly. I suspect I will need to run a separate query to find the closest match if the exact match is not there then run it through the query again. Is there a way to query for the closest match to 'joe' 'bloggs' so it would return 'jo' 'blogg's' for instance? Thanks for your help. Ben
  7. How would I do that within a MySQL query? Is it possible to have an embedded query like: SELECT (SELECT * FROM tbl ORDER BY sur, fore) FROM tbl WHERE rank>110 and rank<120; Also how do you add in the ranking?
  8. I am trying to query a table of people based on there name, then I wish to return the closest match and also the 10 records either side of the match based on a sort of surname, forename. e.g. Search for forename=“Joe” and surname=”Bloggs” would return 11 records as below: ForenameSurname JaneBarnes VickyBates SarahBirt AdamBloggs AnneBloggs JoeBloggs RuthBloggs BeckyBowman PeteBrown GraemeButt PaulCahill My overall aim is to allow users to loop through the table using a name as a reference so for instance in this case 'Joe Bloggs' is the reference and they could then go back 100 records and see something like 'Ben Adams'. Any ideas how this can be done? Thanks Ben
  9. I have been looking into this a little more and it seems that the delivery notification is bounced from the server and not client program. For instance if I am not logged into my hotmail account and I then send it an email from outlook within a few seconds I get a delivery notification. I cant figure out why requesting a receipt in the email header works for Outlook but not my server side script. Thanks Ben
  10. Thanks for the link revraz but unfortunately most email clients don't download the images when the message is opened. cooldude832 what would that header be? If you request a delivery receipt from Outlook you almost always get a notification dont you? Thanks Ben
  11. Hi, I am using the mail function and want to add a delivery request so that I know the message was delivered. This functionality is available in MS Outlook and seems to add the following into the message headers: 'Return-Receipt-To: "Name" <email>'. If I replicate this in my php code it doesn't seem to do anything. Any help would be much appreciated Regards Ben
×
×
  • 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.