Jump to content

scotchegg78

Members
  • Posts

    124
  • Joined

  • Last visited

    Never

Everything posted by scotchegg78

  1. Hi Guys Easy one, but maybe i am tired or full of cold, but my query is wrong??! i am simply trying to check two tables to see if the email has already been registered. But it returns nothing if one of the tables for example job seeker is empty, even though the required email is in the recruiter table already.. SELECT job_seeker.email,job_recruiter.email FROM job_seeker,job_recruiter WHERE (job_recruiter.email = 'test@email.com') OR (job_seeker.email = 'test@email.com'); thanks for any quick fix
  2. hi I want to search a string for a contained pattern. example "Happy Birthday To You" searching for "day" will fail search for "Bir" will pass i am playing with .. var re = new RegExp("^" + t, "i"); but its not right? Any help appreciated.
  3. Hi guys I have made an email newsletter that renders wrong in outlook for some reason, the link images all seem to pick up spacing from somewhere and nothign i can do seems to stop it! the code is... <table width="750" height="174" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td colspan="6" align="left" valign="top" width="750" height="152"> <img src="http://www.scotche.gg/su/suemail_final/SUEMAIL_final_01.jpg" width="750" height="152" alt=""></td> </tr> <tr> <td align="left" valign="top" width="122" height="22" cellpadding="0" cellspacing="0" style="margin:0;padding:0;"> <img src="http://www.scotche.gg/su/suemail_final/SUEMAIL_final_02.jpg" width="122" height="22" alt="" border="0"></td> <td align="left" valign="top" width="113" height="22" cellpadding="0" cellspacing="0" style="margin:0;padding:0;"><a href="http://shawandunderwood.co.uk/about.php" ><img src="http://www.scotche.gg/su/suemail_final/SUEMAIL_final_03.jpg" width="113" height="22" alt="" border="0"></a></td> <td align="left" valign="top" width="118" height="22" cellpadding="0" cellspacing="0" style="margin:0;padding:0;"><a href="http://shawandunderwood.co.uk/advertising.php"><img src="http://www.scotche.gg/su/suemail_final/SUEMAIL_final_04.jpg" width="118" height="22" alt="" border="0"></a></td> <td align="left" valign="top" width="147" height="22" cellpadding="0" cellspacing="0" style="margin:0;padding:0;"><a href="http://shawandunderwood.co.uk/public.php"><img src="http://www.scotche.gg/su/suemail_final/SUEMAIL_final_05.jpg" width="147" height="22" alt="" border="0"></a></td> <td align="left" valign="top" width="125" height="22" cellpadding="0" cellspacing="0" style="margin:0;padding:0;"><a href="http://shawandunderwood.co.uk/exhibitions.php"><img src="http://www.scotche.gg/su/suemail_final/SUEMAIL_final_06.jpg" width="125" height="22" alt="" border="0"></a></td> <td align="left" valign="top" width="125" height="22" cellpadding="0" cellspacing="0" style="margin:0;padding:0;"> <img src="http://www.scotche.gg/su/suemail_final/SUEMAIL_final_07.jpg" width="125" height="22" alt="" border="0"></td> </tr> </table> if anyone knows what to add or alter to fix it it would be a great help!
  4. Hi Guys I am trying to get the phpmailer class working with an image attachment from a html form. It works ( sort of) in that it sends an email with other form elements, but no working attachment. my html form is simply.. <input type="file" name="file" value=""/> and the aspect for the form is... $encoding = "base64"; $type = "application/octet-stream"; $mail->AddStringAttachment($_FILES['file']['tmp_name'],$_FILES['file']['name'],$encoding,$type); -update sorry i should of added i am using string method with the aim of not having to save the file to a server first from upload. If anyone else uses this phpmailer class, i would appreciate some advice. thanks
  5. thanks i will, just trying to get my head around the use of array filter on my 15 input boxes! is this it for just the score post array then.. $filter = array('score' => FILTER_SANITIZE_INT); $cleaninputs = filter_input_array( INPUT_POST, $filter ); or if i had another post in their like colour for example its.. $filter = array( 'score' => FILTER_SANITIZE_INT, 'colour' => FILTER_SANITIZE_STRING); $cleaninputs = filter_input_array( INPUT_POST, $filter ); thanks
  6. hi dan i am not using checkboxes, its 15 input boxes for int values only. so my load values from the post on page load into form would be.. <input type="text" class="text" name="score[5]" id="score_5" value="<?php echo $_POST['score'][5]"?>" /> ? Is that right? thanks
  7. ok thanks this maynot make sense, but then would i not have to put my form 15 inputs into an array? like <input type="text" class="text" name="score[]" id="score_1" /> <input type="text" class="text" name="score[]" id="score_2" /> <input type="text" class="text" name="score[]" id="score_3" /> etc sorry just not used php filter array before. and to keep the entered input on page reload how do i access these from the post array? is it.. <input type="text" class="text" name="score[]" id="score_1" [b]value="<?php echo $_POST['score[1]']?>"[/b]/> ?? that looks wrong!
  8. would you not have to run through it putting each value into another temp array as you go, then on each step check your temp array for its content against your new entry?
  9. HI guys I have a form collecting just .. 15 input boxes of numeric numbers 1-10 a colour enum- red, white yellow or blue. hidden userid field. is it better to have 15 instances of.. $score_1 = filter_input(INPUT_POST, 'score_1', FILTER_VALIDATE_INT); $score_2 = filter_input(INPUT_POST, 'score_2', FILTER_VALIDATE_INT); $score_3 = filter_input(INPUT_POST, 'score_3', FILTER_VALIDATE_INT); or do something with the php input array function? Does it really make a performance difference? thanks for advice.
  10. decorate the class?! sorry fella whats that?
  11. thanks 10 was just an example number, its the idea of modeling something within something. Think footballers = foo, bar = game of football etc. a game has 10 instances of footballers. how would i access say the 4th instance in the array of classes? $this->foos[3]->getid(); for example?
  12. make sure you check your posts before sticking them in the DB first... run em through this function... function safe($value){ return mysqli_real_escape_string($con, $value); }
  13. hi guys If i want an array of classes as a variable within a class is this correct.. class foo { } class bar{ private foos= array(); function __construct() { for($i = 0; $i < 10; $i++) { $this->foos[] = new foo; } } } Is this right? I am trying to readup on this aspect of OO to recap but cannot find any reference to this requirement if anyone knows of a book or site? thanks for any tips..
  14. Hi Guys I have a page where content scrolls behind the footer. It all works fine, but some users do not realise the disappearing content just needs scrolling up to see it! So i plan to add a arrow on the right handside that appears exaclty the same as the browser scroll bar, then if clicked the arrow also scrolls down the page, much like the user used the mouse scroll wheel or the side browser scroll bar. Whats a good quick solution to this? thanks
  15. Hi guys I have a great fun task, but its easy to get this wrong. I have to model something where people get scores from games and then submit their results. In doing this they unlock medals, which could be anything from 1 win, 5 wins on the trot, 4 headshots in a game, used weapon. number of kills, 10 kills a game medal, 20 kills a game medal. etc etc Ignoring the fact they have to enter their stats and be trusted, the issue is how to model this setup? I am assuming when a game result is submited i would check this now and then in an table for medals I would allocate they have got the medal? This seems better than checking the medals table on EVERY page load against all old scores to re calculate the results each time? Anyone ever done anything like this or got any thoughts on the best model for this, and anything else worth noteing? thanks for any input.
  16. Guys I am a php developer who wants to develop a social site that one would of course dream could one day deal with the volumes twitter and facebook do . Now of course its only a dream, and its no its not another of the same, but instead a targeted market. So rather than just make an OO php site, stick it on a server and hope it goes well, I would like to learn and understand the requirements on dealing with mulitple mass users and requests and scalibity of demand and the coding techniques to support this. How or where can i learn or read about this specific way of developing? thanks for any guidance here.
  17. Hi Guys If i want to use a domain at 123 reg but have the web traffic come to my VPS which tags do i use? Is it just... @ (A tag), my ip www (a tag) my ip * ( a tag) my ip And leave the mx records alone for email, or do i also leave the @ tag alone aswell, is this for email? also is it just * to catch the no www domains. thanks alot for any help!
  18. Hi guys I hav a company table and an image table. Image table has (id,companyid,ext) so you can of course have duplicate companyids if the code has allowed it. But i want to join on company and only get one if there are more! I do not get the image.companyid so can not make this distinct in the select, so how can i join so i only get one instance? at the moment the join is ... LEFT JOIN image on image.recruiterfk=company.id group by ?? thanks
  19. thanks i used this update table set part1 = (substring_index(data,',',1)) for first part and update table set part2 = (substring_index(data,',',-1)) for the 2nd part maybe a better way, but it did hte job
  20. Hi guys I have a var 255 column called data which has the format ' part1,part2'. I want to extract and put part1 into its own column, and part2 into its own column. so something like update table set part1 = data(part1); What can i use to match all text before the , a reg expression?? thanks
  21. Hi guys sorry was a little vague. mysql table... poscode,town,county,city. csv file is in the order... town, county,postcode,city. And can be like this... Aberdeen,Aberdeenshire,"AB1, AB2",Aberdeen,Scotland "Aberlour, Turriff","Aberdeenshire, Banffshire, Kincardineshire",AB3,Aberdeen,Scotland where a postcode can also cover mulitple towns. TO be honest I am a little confused now, i need to think how best to store this in the db and use it, as a post code can have many towns, and a town many postcodes! I have a table of postcodes and lats and longs, and i wanted to add a column or reference table so i can also work out distance from a name by finding its postcode. Get me?
  22. Hi guys I have a CSV File like below... Birmingham," B1,B12,B37" London," SW1,SW2" I need to parse this with php to get it into a table postcode for each postcode and town, example Birmingham B1 Birmingham B12 Birmingham B37 London SW1 London SW2 Are there any good re usable php mysql cvs classes? thanks for any help
  23. thanks for the reply, i will try it, but i have it working now using this... SELECT sub.distance,jp.PostCode FROM (SELECT 60 * 1.1515 * DEGREES(ACOS(SIN(RADIANS(52.478)) * SIN(RADIANS(jp.Lat)) + COS(RADIANS(52.478))* COS(RADIANS(jp.Lat)) * COS(RADIANS((-1.741)-jp.Long))))as distance FROM job_postcodes jp) sub, job_postcodes jp WHERE sub.distance < 20 however it takes 1.9 seconds , which i think is a bit long.
×
×
  • 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.