Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Ingolme

    array in mysqli query

    I made a mistake, the fetch() method is called on the statement itself while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
  3. Ingolme

    Need some help to fix the background of a text box

    It looks like the behaviour of the letter-spacing property is to add additional space to the right of each letter rather than equally distribute it on both sides. This means that you will have to adjust the padding to accommodate that. Since the letter spacing is in ems, you'll have to define the padding in ems and have the right padding be the letter-spacing amount less than the left padding.
  4. Today
  5. I have some knowledge about html and css and I am confident in beeing able to hack through most problems through trial and error, but in this case I dont even have an idea on how to fix it and I am afraid it's really simple. So I simply want this black background behind the text and it's supposed to be equal on both sides, but the padding starts virtually too late for that to work. body {position: relative;} body,html,h1,h2,h3,h4,h5,h6,p {font-family: "Lato", sans-serif;} body, html { height: 100%; color: #777777; line-height: 1.8;} html {font-size:1rem;} body {font-size:100%;} h1 {font-size: 1.777em; text-align: center; color: white;} .headline2 {letter-spacing: 0.8em;} .w3-wide {letter-spacing: 0.625em;} <div class="bgimg-1 w3-display-container w3-opacity-min" id="home"> <div class="w3-display-middle"> <h1><span class="w3-black w3-padding-large w3-wide w3-animate-opacity">THORSTEN ERDT</span></h1> <h1><span class="headline2 w3-animate-opacity">ILLUSTRATION</span></h1> </div> </div>
  6. westman

    array in mysqli query

    using.... echo $result; my output is 1
  7. iwato

    array in mysqli query

    Make sure that $result is not empty. Enter $result = $stmt->execute($uniqueValueArray_id); below $result = $stmt->execute($uniqueValueArray_id); and make sure that $result is not empty. Also make sure that you are using the proper fetch-style. I do not use PDO, so I cannot help you any further. Roddy
  8. westman

    array in mysqli query

    Thank you for your support. I really appropriate it. I am having a problem with this line... while($row = $result->fetch(PDO::FETCH_ASSOC)) {
  9. dsonesuk

    action_page.php

    Wha? Same way you would with multiple input types, 'name' attributes with different 'name' attribute values
  10. ameliabob

    action_page.php

    Is there a way that I can view the action_page.php so I can see what the server side looks like for a submit button? Also How do I differentiate between multiple submit buttons?
  11. Ingolme

    array in mysqli query

    First, you have to use prepared statements to send data to your queries. If you don't it's highly likely that some unexpected data will cause errors in your query and break your program and in the worst case scenario this can be used to hack your website. You can use the IN() operator to compare a field to multiple values. This works best in PDO, where you can pass parameters as arrays: <?php $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // Set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Build a string of placeholders like ?,?,?,?, one for each array element. $amount = count($uniqueValueArray_id); $placeholders = array_fill(0, $amount, '?'); $search = implode(',', $placeholders); // Prepare the statement $limit = 5; // Make absolutely sure this value is an integer or the program will break $stmt = $conn->prepare("SELECT id, text, date, FROM text WHERE id IN ($search) ORDER BY id DESC LIMIT $limit"); // Run the statement, passing in the values $result = $stmt->execute($uniqueValueArray_id); while($row = $result->fetch(PDO::FETCH_ASSOC)) { // Display the result here however you want print_r($row); }
  12. westman

    array in mysqli query

    $seach = ''; foreach ($uniqueValueArray_id as $key => $value) { $seach .= 'id='.$value; $seach .= ' OR '; } $seach = rtrim($seach,' OR '); echo $seach; $sql = "SELECT id, text, date, FROM text WHERE $seach ORDER BY id DESC $limit"; $query = mysqli_query($conn, $sql); I am getting closer but I do have a problem with the query still. Any help?
  13. westman

    array in mysqli query

    Is it even possible to run an array through a query?
  14. westman

    array in mysqli query

    $uniqueValueArray[] = $mainRow; // my array $sql = "SELECT id, text, date FROM text WHERE id='My Array' ORDER BY id DESC $limit"; $query = mysqli_query($conn, $sql); How do I make a query look for an array?
  15. dsonesuk

    Jquery - function when resizing window

    The idea is to make CSS media queries control what menus and styling is used, then use JavaScript to reset menu state (collapse) on resize. The menu click should use single click event to toggle, OR on clicking of element identify what state the menu is (collapsed or not), then do the opposite. You need to let CSS control as much as possible of the menu and styling of the page, since with media queries and CSS3 new features means more of this is possible.
  16. philipp

    Problem with background video in Chrome browser

    <video width="100%" height="100%" autoplay loop> <source src="https://hostpart.ch/Beach - 14297.mp4" type="video/mp4" />Your browser does not support the video tag. I suggest you upgrade your browser. <source src="https://hostpart.ch" type="video/webm" />Your browser does not support the video tag. I suggest you upgrade your browser. Your browser does not support the video tag. </video> oder <div class="homepage-hero-module"> <div class="video-container"> <div class="filter"></div> <video autoplay loop class="fillWidth"> <source src="https://hostpart.ch/Beach - 14297.mp4" type="video/mp4" />Your browser does not support the video tag. I suggest you upgrade your browser. <source src="https://hostpart.ch" type="video/webm" />Your browser does not support the video tag. I suggest you upgrade your browser. </video> <div class="poster hidden"> <img src="https://hostpart.ch/Beach - 14297.mp4" alt=""> </div> </div> </div> Both codes work, just not in CHROME.
  17. Ingolme

    Problem with background video in Chrome browser

    I can't help without seeing what code you used to put a video into the background.
  18. Hello can someone help me? I have a background video embedded with a placeholder on the web page. Works great in most browsers, just not in Chrome. Is there a solution for this? Thank you very much
  19. Nic727

    Jquery - function when resizing window

    Ok I have the answer: if($(".mobile-menu").click(function(){ $(".right-menu").addClass("Collapse"); $(".fas.fa-times").addClass("Collapse-x"); })); if($(".close-mobile-menu").click(function(){ $(".right-menu").removeClass("Collapse"); $(".fas.fa-times").removeClass("Collapse-x"); })); if ($(window).on('resize', function () { // console.log($(this).width()) if($(window).width() > 840){ $(".right-menu").removeClass("Collapse"); $(".fas.fa-times").removeClass("Collapse-x"); } })); 1. I changed to class for now, but maybe I will change back to inline-style since I didn't have a lot... 2. I guess I can remove all the "if" statement right? A bit useless...
  20. Hi, I'm making a mobile menu on my website and I have a problem. When making my browser window reaching 840px and smaller, the hamburger icon is showing. I click on it and my menu is appearing, but if I keep the menu open and go back to a window bigger than 840px I have two bugs: 1. If I close the mobile menu, it make items opacity 0. So when returning to normal menu, items are still transparent. 2. If I keep mobile menu open and go back to normal menu, menu is showing… Ok, but when returning back to smaller screen, mobile menu is still here. I tried something like that, but it doesn't work. if ($(window).width() <= 840) { $(".mobile-menu").click(function(){ $(".right-menu").height('100%').css({ opacity: 1 }); $(".fas.fa-times").css({ top:'50px' }); }); $(".close-mobile-menu").click(function(){ $(".right-menu").height('0%').css({ opacity: 0 }); $(".fas.fa-times").css({ top:'-50px' }); });}else{ $("right-menu" && ".fas.fa-times").removeAttr('style'); } The last part of the code is supposed to make inline-style disappear, but it doesn't because it doesn't activate the function when resizing, but only when it's loading at a higher screen width. Is there a way to make this work when resizing to window width higher than 840? Thank you
  21. Yesterday
  22. gordonisnz

    CSS3 - Trying to center a menu.

    Found it - w3-center (in the 'text' part of the site.. https://www.w3schools.com/w3css/w3css_text.asp ) - i was thinking of it as a menu, not plain text
  23. gordonisnz

    CSS3 - Trying to center a menu.

    https://www.w3schools.com/w3css/w3css_navigation.asp Hello. I'm trying to do a BASIC (see above site for example) navigation on my site - Its working fine, however the div/container fills 100% of the width of the screen. Has anyone got an example of how to do a navigation - But if the text/wording does NOT fill up the entire width of the screen - it automatically centers. Ive used width:auto; and text-align center etc - but nothing works. I CAN make the div smaller (say 50%), and the text is centered, But if i add more menu items, the text word-wraps for half the screen instead of going the full width of the screen. ALSO, who / how do we contact the designers of the above website to add an example of how to center a menu. SO FAR i have: <div class="w3-display-container" style="width:75%; margin-left: auto; margin-right: auto; text-align: center;"> <div class="w3-bar w3-display-topmiddle"> <span class="w3-bar-item">Select a letter: &nbsp; </span> <a href="/letter/p" class="w3-bar-item w3-button w3-mobile">p</a> <a href="/letter/r" class="w3-bar-item w3-button w3-mobile">r</a> <a href="/letter/w" class="w3-bar-item w3-button w3-mobile">w</a> </div> </div>
  24. It took some time to find it, but I was finally able. Unfortunately, I was unable to find anything in Chrome, and I have long since given up on Safari, as it is next to useless in my current operating environment. The following is the procedure used to display the structure and contents of a result object that is generated in a PHP file called with an AJAX request. Open the Firefox Console and find the Network tab. While in the Network tab find the javascript (.js) file responsible for calling the PHP file that generates the JSON object. Highlight the file by clicking on it. While the file is still highlighted click on the XHR tab. This will cause the relevant .php file(s) to appear below the highlighted .js file. Click on the PHP file of interest and find the Response tab in the appropriate corresponding box. It is in the viewport of this box that the object appears. Click on the various objects, arrays, and other components of the object to learn how it is structured and to display the values. Have a great weekend! Roddy
  25. ProfBurnett

    Joint Certification

    Hello, I’m a professor at Montgomery College, Maryland and I am the lead instructor for all web development courses for the Information Technology Institute (ITI). ITI training is specifically designed for workforce development courses (non-credit) and not matriculating credit courses. The courses are designed for working professionals. I use W3Schools for many of my training materials. Students love the interactive exercises and use the interactive tools to provide hybrid course material so students can continue to learn after the formal instruction is completed or while they are at home. The reason for this inquiry is to open up a discussion about setting up a joint certification program for the college and W3Schools. I believe more students would get certified if both the Montgomery College, ITI and W3Schools were the certifying agencies. Please contact me at carl.burnett@montgomerycollege.edu.
  26. iwato

    How to Prepend Zeros to a Numerical Value

    So, in conclusion, .pad(size) is a user-created method of a primitive Number object that is called via the Number.prototype property and executed by either the parentheses operator or variable assignment. Do I have everyone's agreement. Roddy
  27. iwato

    Dysfunctional Dynamically Introduced Stylesheet

    Oh well, infinity wins out. For, it is only bounded by the imagination, and it seems to be without end. At least, until I die, and someone else's carries on. Roddy
  28. Ingolme

    Dysfunctional Dynamically Introduced Stylesheet

    That is not a contradiction. The width is restricted to any value less than or equal to 100% of its parent's width. It is not allowed to be 200% or 400%. The range of valid values used to be from 0 to infinity, we have restricted it to the range [0, 100].
  1. Load more activity
×