Jump to content

Adamhumbug

Members
  • Content Count

    265
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Adamhumbug

  • Rank
    Advanced Member

Recent Profile Visitors

1,971 profile views
  1. Final Solution function getRentalItems($display){ include 'includes/dbconn.php'; $stmt = $conn -> prepare(' SELECT i.id, item, it.type, price_GBP, price_USD, price_CAD FROM items i LEFT JOIN item_type it on i.type = it.id order by i.type desc '); $stmt -> execute(); $stmt -> bind_result($id, $item, $type, $gbp, $usd, $cad); if($display == 'Options'){ $out = ''; $t = ''; while($stmt -> fetch()){ if ($t == $type){ $out .= "<option data-item='$type' data-GBP='$gbp' data-USD='$usd' data-CAD='$cad' value='$id'>$item</option>"; }else{
  2. ok much closer now. Still struggling a bit as you can see function getRentalItems($display){ include 'includes/dbconn.php'; $stmt = $conn -> prepare(' SELECT i.id, item, it.type, price_GBP, price_USD, price_CAD FROM items i LEFT JOIN item_type it on i.type = it.id order by i.type desc '); $stmt -> execute(); $stmt -> bind_result($id, $item, $type, $gbp, $usd, $cad); if($display == 'Options'){ $out = ''; $t = ''; while($stmt -> fetch()){ if ($t == $type){ $out .= "<option data-item='$type' data-GBP='$gbp' data-USD='$usd' data-CAD='$cad'
  3. Thanks for that i feel like i am getting close. i have this now function getRentalItems($display){ include 'includes/dbconn.php'; $stmt = $conn -> prepare(' SELECT i.id, item, it.type, price_GBP, price_USD, price_CAD FROM items i LEFT JOIN item_type it on i.type = it.id order by i.type desc '); $stmt -> execute(); $stmt -> bind_result($id, $item, $type, $gbp, $usd, $cad); if($display == 'Options'){ $out = ''; $t = ''; while($stmt -> fetch()){ if ($t == $type){ $out .= "<option data-item='$type' data-GBP='$gbp' data-USD='$usd' data-CAD=
  4. Hi All, I have a table, the column type is an attribute that items in this table share. A simple explanation would be if the field was colour and the items could be one of the colours. I am struggling with a for each loop to get the items out of this table grouped by this value. I am wanting to create a dopdown where the item_type is a header. This is what i have so far which obviously doesnt work: unction getRentalItems($display){ include 'includes/dbconn.php'; $stmt = $conn -> prepare(' SELECT i.id, item, it.type, price_GBP, price_USD, price_CAD FROM items
  5. I immediately saw my issue as soon as i wrote the above. I was including head at the start of the register document rather than just above the html.
  6. Hmm, i am sure i am being very simple here but im not sure i follow. I have updated the code in my head.php to what is in the post above. Most of my other pages include head.php On my register page i have the following error: Register line 73 is: header("location: register.php?user_may_exist"); and head line 14 is the last line of this: <?php if(isset($currentPageTitle)){ $curPage = $currentPageTitle; }else{ $curPage = 'Baldock Town Cricket Club'; }; if(isset($currentPageMeta)){ $desc = "<meta name='description' content='$currentPageMeta'>
  7. Do i not still have to include something after the html section? Like follows: <?php if(isset($currentPageTitle)){ $curPage = $currentPageTitle; }else{ $curPage = 'Cricket Club'; }; if(isset($currentPageMeta)){ $desc = "<meta name='description' content='$currentPageMeta'>"; }else{ $desc = "<meta name='description' content='All the latest from CC'>"; }; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> <?= $curPage ?> </title> <?= $desc ?> <meta name="viewport" content="
  8. Hi All, I am trying to use headers at the end of functions to put the user where they need to be. header("location: register.php?user_may_exist"); I understand how they work and their qwuirks. My issue is, in my head file, i am outputting which causes issues for the headers which come after. I have the following in head.php <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> <?php if(isset($currentPageTitle)){ echo $currentPageTitle; }else{ echo 'Cricket Club'; }; ?> </title> <?
  9. Thanks all for this - opened the door a little for me
  10. I wasnt sure where best to put this question. I have a website that i built locally using mamp, i now have this hosted with 1&1 and its working online. I am trying to continue development locally rather than playing with the live version but when i now try and navigate to it via local host i get the following error: SSL_Error_rx_record_too_long Anyone got any hints?
  11. So it was uploading the image and putting it in the correct folder. It was also adding the file name to the person table image column. None of these things are currently happening. I will have a look into that.
  12. I have a form that includes uploading a headshot. This is the form handling f ($_SERVER['REQUEST_METHOD']=='POST'){ $fn = $_POST['fname']; $ln = $_POST['lname']; $ad1 = $_POST['ad1']; $ad2 = $_POST['ad2']; $city = $_POST['city']; $post = $_POST['postcode']; $tel = $_POST['phone']; $email = $_POST['email']; $crole = $_POST['comRole']; $OFA = $_POST['OFA']; $playerType = $_POST['playerType']; $team = $_POST['primaryTeam']; $dob = $_POST['dateOfBirth']; if(!empty($_FILES['fileToUpload'])){ $errors= array(); $file_name = $_FILES['personHeadshot']['name'];
  13. I think the issue is that the values going into the array are strings not integers. I used this to solve my problem function existingTags(){ var plta = $('#peopleLinkedToArticle').val() plta = plta.split(',') taggedPeople = plta for (a in taggedPeople ) { taggedPeople[a] = parseInt(taggedPeople[a], 10); } console.log(taggedPeople) }
  14. Hi All, I have a function: function existingTags(){ var plta = $('#peopleLinkedToArticle').val() window.taggedPeople = [plta] console.log(taggedPeople) } This console log shows the following which is correct. Array [ "11,2" ] I have a second function that needs to use tagged people function removeTaggedPeople(){ console.log(taggedPeople) var e = event.target $(e).attr('onclick','tagInArticle()') var taggedPerson = $(e).data('id') var i = 0; while (i < window.taggedPeople.length) { if (window.taggedPeople[i] === taggedPerson) { window.ta
×
×
  • 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.