Jump to content

yogibear

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by yogibear

  1. Hi all I have a question about how much I should charge for being an IT consultant for a local church. I have been working for several small companies for a number of years now, normally I take whatever they are willing to pay per hour (they always have an idea). Problem is the church has no idea what a suitable amount is. I don’t what to suggest an amount that may be higher than the going rate for an IT consultant due to the fact it is a church and there are a number of volunteers working there. I’ve been there a couple of times to see what is required, so far it seems like it is just to set up broadband, a wireless network for a laptop and delete all the files of a priest who has retired. Not exactly complicated stuff. I’m currently studying for a BSC(Hons) in computing, I completed a BTEC National Diploma in computing with grade Distinction-Distinction-Distinction, equivalent to 3 A’s at A-level. 6 years working as a freelance IT consultant. Any idea of the amount that would be suitable would be great and much appreciated. Thanks in advance. Yogi bear
  2. Hi At the moment I have a textbox for a post code text box that when the user clicks submit, if the input doesn’t contain a space and alert is displayed saying post code must contain a space. How can I change it so that it adds a space after the 2nd character? I know this isn’t perfect but it will prevent errors on the next page (not controlled by me) saying the post code must contain a space (the postcode is not displayed to user). Thanks in advanced Best wishes Yogi
  3. Hi I see what I did the ! was in the wrong place. Thanks anyway yogi
  4. Hi I am using FPDF to create a PDF document using results in a mysql database. The following code doesn’t work and always returns a 0 $Name = "Joe Bloggs"; $result=mysql_query("SELECT Name FROM payment WHERE Name = '$Name' ORDER BY Payment_id",$link); $payments = mysql_numrows($result); $column_payments = $column_payments.$payments."\n"; But this code works and I can’t see what is causing the problem. $result=mysql_query("SELECT Name FROM payment WHERE Name = 'Joe Bloggs' ORDER BY Payment_id",$link); $payments = mysql_numrows($result); $column_payments = $column_payments.$payments."\n"; Any ideas Thanks yogi
  5. Hi Thanks for your help But I have now fixed the problem using a series of if statements, it may not be perfect but it gets the job done. I will save your code as it is a much more efficient way of doing what I was trying to accomplish. Best wishes yogi
  6. Hi Thanks for your reply On one of my other pages the user can enter information to search the database in several different textboxes and some drop down menus. For that page I use LIKE and if one of the textboxes hasn’t had information entered it won’t only return the results that have an empty field. This is the code I use for that page: $result = mysql_query("SELECT * FROM Record WHERE Date_of_flight LIKE '%$new_date%' AND Pilot_name LIKE '%$Pilot_name%' AND Take_off_airfield LIKE '%$Take_off_airfield%' AND Arrival_field LIKE '%$Arrival_field%' AND Payment_method LIKE '%$Payment_method%'"); For this new page I want to be able to search the database in the same way but be able to search between two dates as well, and if the two dates haven’t been entered it doesn’t return records that have an empty date field. Best wishes Yogi
  7. Hi Is it possible to use LIKE, AND & BETWEEN in the same sql statement? Something like: $sql = "SELECT * FROM payment WHERE Name LIKE '%$Name%' AND Date BETWEEN LIKE '$new_date1' AND LIKE '$new_date2' LIMIT $offset, $rowsperpage"; Best wishes Yogi
  8. Hi Thanks for your help Works perfectly, the only thing thats a little weird is the textboxes went from being displayed in 2 sets of 3 to being displayed in one line. Puting them in a table with a cell each solved this problem. Best wishes yogi
  9. Hi all I’m having a little trouble with JavaScript and knowing very little about JavaScript I’m not doing very well. I have two radio buttons on my page, when the first is selected a drop down menu appears next to it. This part works perfectly, thanks to an example I found. The second radio button should display a total of six drop down menus. I can’t figure out how to modify what I have to make it work. This is what I have for the first radio button <SCRIPT language = JavaScript> function show() { var i = 0; var el; while(el = document.getElementsByName("radio1")[i++] ) { // alert(i); (document.getElementById('radio'+i).checked) ? document.getElementById('drop'+i).style.display="block" : document.getElementById('drop'+i).style.display="none" } } </script> Please can you tell me what I need to change? Best wishes Yogi
  10. Hi Can you tell me how to fix this, I know the problem is the quotes. I have been trying to copy the fix on http://www.phpfreaks.com/forums/index.php/topic,120612.0.html but have had no luck. echo '<script language="javascript" type="text/javascript"> <!-- window.setTimeout('window.location="http://www.***.co.uk/record/admin/main.php"; ',2000); // --> </script>'; Best wishes yogi
  11. Hi Thanks for your help Didn’t fix it but you got me thinking and I found a solution. The problem was the date was always being submitted with a couple of -- even when nothing had been entered for the date, so it was always searching the database using the “--”. So a simple if statement that checked $new_date for “--” solved the problem. This was something that no one who read the post could have known, so thanks for your help. Best wishes Yogi
  12. Hi Thanks for your help I have just re-read my post and I don’t think I was clear, sorry I was getting a bit tired of PHP last night. I tried changing the code like you said but no results were found. Here goes my second attempt at my post. I have a form that searches a database, I want it so that it will search using any of the information that has been entered e.g if the pilot name has been entered it will return results with that name even if the date, arrival field or any other field is incorrect. I think I am correct in thinking that is what “LIKE” is used for. It currently works fine on all fields except the date, if I enter the pilot name and the date is the 00/00/0000 it will only return flights for that pilot on that date and not all flights for that pilot which is how I would like it. If you got what I was trying to say on my first post and I do need a = then I apologise, if this is the case how do I stop it returning no results for searches. Best wishes yogi
  13. Hi I have a search on one of my pages that should search the database using any of the information that has been entered in the form. It almost works but the date needs to be the same as the date in the database for it to find a record. It’s like the “LIKE” doesn’t affect the date, how can I fix this? This is the code I have: $result = mysql_query("SELECT * FROM Record WHERE Date_of_flight LIKE '%$new_date%' AND Pilot_name LIKE '%$Pilot_name%' AND Take_off_airfield LIKE '%$Take_off_airfield%' AND Arrival_field LIKE '%$Arrival_field%' AND Payment_method LIKE '%$Payment_method%'"); Best wishes Yogi
  14. Hi Thanks for your help, it works perfectly now. Can I say that is some seriously fast response times, very impressive. Best wishes Yogi
  15. Hi I have a mysql query and I want to use a session to select from the database WHERE username equals the contents of the session. Sorry if I have not been clear, I am finding it difficult to explain. My attempt at the code may make it easier to understand what I am trying to do. $result = mysql_query("SELECT * FROM User WHERE Username='$_SESSION["username"]'"); I have tried this code but I get an error. Best wishes yogi
  16. It works! Thank you, I really appreciate it. It's nice to know that there is a community that are willing to help. Best wishes, thanks again yogi
  17. Hi This isn’t my first attempt at php but I haven’t used it for a while and am a little confused. I have been asked if I can create a site that records flight details that users enter. I am on the date, one thing I remember having problem with in the past. This is the code I have: $day = $_POST['day']; $month = $_POST['month']; $year = $_POST['year']; $new_date=$year."-".$month."-".$day; echo "$new_date <br>"; $sql="INSERT INTO Record(Date_of_flight, Pilot_name, Take_off_airfield, Arrival_field, Start_time, Take_off_time, Landing_time, Shut_down_time, Charge_time_of_flight, Number_of_landing, Number_of_tags, Deductible_charges, Payment_method, Comments) VALUES ($new_date,'$_POST[Pilot_name]','$_POST[Take_off_airfield]','$_POST[Arrival_field]','$_POST[start_time]','$_POST[Take_off_time]','$_POST[Landing_time]','$_POST[shut_down_time]','$_POST[Charge_time_of_flight]','$_POST[Number_of_landing]','$_POST[Number_of_tags]','$_POST[Deductible_charges]','$_POST[Payment_method]','$_POST[Comments]')"; This is the error I get: I also get $new_date displayed above, so that is working correctly. Any help would be great Thanks yogi
  18. yogibear

    update

    Hi all I think I have solved it thanks for your help anyway
  19. yogibear

    update

    Hi Didnt solve it, thanks for your fast reply any other ideas yogi
  20. yogibear

    update

    Hi can anyone see whats wrong with this code when I remove clientref and ourref it works. I dont get any errors and the records dont update. $customer = $_POST[customer]; $clientref = $_POST[clientref]; $ourref = $_POST[ourref]; mysql_query ("UPDATE salesledger SET customer = '$customer', clientref = '$clientref', ourref = '$ourref' WHERE ourref = '$_POST[ourref]'"); echo "1 record updated"; Thanks for help yogi
  21. Hi all I have been working on and admin system for one of my sites and i need to be able to enter a client name and have list of all the jobs i have done for this pertiular client this i have done but i need a way of selecting one of them and being able to edit/update the information for this job. how would i go about this? thanks for your help yogi
  22. Hi It almost works I think that it’s this bit because it now displays $car and if I swap the position of $colour with $car $colour then works but $car doesn’t, it is only the first line that works. I have also tried echo $car; and echo $colour; and get the same results. Is there something that is meant to go between these lines of code? $car = $row['car']; $colour = $row['colour']; $alloys = $row['alloys']; Many thanks Yogi
  23. while($row = mysql_fetch_array($result)) $car = $row['car']; $colour = $row['colour']; $alloys = $row['alloys']; $img = "<img src='/images/$car_$colour_$alloys.jpg'>"; { echo $img; } Thank you for your reply I still have the same problem this is the current code when i open the page and right click where the image should be and click properties the URL that is shown is http://www.***.co.uk/images/.jpg>
  24. Hi all a question about storing image paths in a database I will have hundreds of images stored in an images folder. I have 14 columns in my database and the information in each changes which picture that is displayed. All the images will be .jpg and have file names like Vauxhall Corsa_Red_1_2_1_2_1_2_1_1_1_2_2_1.jpg This is what I have, I tried I few different things but I have removed them to make it less confusing for me and easier to explain, hopefully. $img = "<img src='/images/$car_$colour_$alloys'.jpg>"; { echo $img; } the above code should only display Vauxhall Corsa_Red_1.jpg which I have made for a test can someone tell me what is wrong with my code I know it is very wrong? Many thanks and thanks in advance Yogi
×
×
  • 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.