Sunamena

Members
  • Content count

    73
  • Joined

  • Last visited

Everything posted by Sunamena

  1. Hey all, I have created a website on my local host. Now that i try to upload it, i get many errors. Such as this one: $result = $stmt -> fetchAll(PDO::FETCH_NUM); ERROR: Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetchAll() in /customers/c/5/e/sunamena.be/httpd.www/eldiemus/nieuws.php:290 Stack trace: #0 {main} thrown in /customers/c/5/e/sunamena.be/httpd.www/eldiemus/nieuws.php on line 290 And will this still be valid? $stmt -> bindParam(':datum', $datum, PDO::PARAM_INT); I also had to change my connection method from $db = new PDO('mysql:host=urlToDatabasel;dbname=DatabaseName', 'DatabaseName', 'NotARealPassword'); $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); to $con=mysqli_connect("sunamena.be.mysql", "sunamena_be", "s6X6tyUj", "sunamena_be"); This is still save to use without the setAttribute?
  2. The new code should be MySqli $sql="SELECT * FROM nieuws ORDER BY nieuwsID desc"; $deelStap=mysqli_query($con,$sql); $result=mysqli_fetch_all($deelStap,MYSQLI_NUM); $numberInResult = count($result); But how to fetch one?
  3. Thanks. This problem has been solved =D
  4. Hello everyone, I have an issue with uploading an image, but i can not seem to figure out what might be the problem. I am new to adding images. I would like to thank you all in advance for your asistance =D This is the PHP code: And this is the form
  5. Hello everyone. The Flexbox design I am currently working on, is working fine as you can see here: http://bronies.be/example/index.html But there is an error on the following pages: http://bronies.be/example/contact.php It does not cover the full width. And even worse here: http://bronies.be/example/404.html It does not even show the aside image. Disclaimer: This is a work in progress. Only parts of the website have been uploaded in order to ask this question. I notice that this happens on pages with little content. But i do not want this to happen, but it does. What am I exactly doing wrong? Thanks in advance for your assistance!
  6. This is currently my Function: function insertText(elemID, text) { var elem = document.getElementById(elemID); elem.innerHTML += text; } And this is my onclick: onclick="insertText('bericht', 'mytext');" What it needs to do is add mytext at the END of the current text in my Textarea. This function works, but as soon as i enter something IN the textarea, the function stops working. Does anyone here know how to solve this issue?
  7. Your code is fine. It works over here. Did you try it in different browsers? I used Chrome. Remember, if you ever visited the page, the color will be selected FROM visited, and not from link. Delete your cookies, close your browser, or try to type a link to a website your sure you have not yet visited.
  8. As dsonesuk sayd: you have to select them and then assign css to them. For example i have <td class="dontShow"> on my website. I do not want this cell to be seen. I have two options in CSS. .dontShow { Display: none; } Or .dontShow { Visibility: hidden; } The difference is, that display none will remove it from your webpage and the visibility will just make it not be there, but it will still take up the space as if it did exist.
  9. Strange something: It does indeed work like this: <head> ,,, <script type="text/javascript"> function insertText(elemID, text) { var elem = document.getElementById(elemID); elem.value += (' ' + text); } </script> ... </head> But i encounter the issues when i do this: <head> ... <script src="js/mylibrary.js"></script> ... </head
  10. Thanks, this works =D it seems that %s% Includes S and s. =D
  11. Hello, I want to have something like the WHERE command. A user types something, for example: "peer". I want a WHERE that also includes "Peer" and "PeEr" and "apeer" and "Peert. Is this by any chance possible? Thanks in advance =D
  12. As soon as i start typing in the textarea and press the image with the onclick command, it stops functioning. Both innerHTML and value put the content IN the textarea, but NOT anymore once any action has been preformed inside the textarea (such as deleted or typed something)
  13. Is a flexbox what you are looking for? With a flexbox you can easily grid content. And i find it easy to get it responsive. Here you can find a step by step guide. https://css-tricks.com/snippets/css/a-guide-to-flexbox/
  14. Is it possible to share the HTML and CSS code required for your entire canvas? That way we can better see and help solve your issue
  15. :voor is an INT. I do use Try and Catch, but i left that out of the code (i wanted to focus on the part that did not work). =D And dsonesuk: Yes i did, i did it once to much =D And the previous one had to be a fetchAll =D This problem has been solved. Thanks all =D
  16. Hello everyone, this is what i want to achieve: When someone looks in his or her Inbox, (s)he can see all messages directer to him or her. This is my code (the part which is needed for my question ;)): $sql = "SELECT * FROM berichten WHERE voor = :voor ORDER BY berichtid"; $stmt = $db -> prepare($sql); $stmt -> bindParam(':voor', $voor, PDO::PARAM_INT); $voor = $_SESSION["userID"]; $stmt -> execute(); $result = $stmt -> fetch(PDO::FETCH_NUM); $numberInResult = count($result)-1; // THIS IS TO CHECK MY RESULTS print_r($result); echo "<br><br><br>"; echo "<br><br><br>"; echo $numberInResult; // Number in results is 5. (Which is incorrect, the test person has 7 messages. The table does have 6 rows, which is why the result is 5, atleast i think. for ($i = 0; $i < $numberInResult; $i++) { ?> <div class="inbox-row"> <div class="inbox-data"> <?php echo $result["1"]; ?> </div><!-- --><div class="inbox-data"> <?php echo $result["2"]; ?> </div><!-- --><div class="inbox-data"> <?php echo $result["5"]; ?> </div><!-- --><div class="inbox-data"> Verwijderen </div> </div> // And i get to see 5 times the first message send to me. // Which should be 7 different messages send to me. // I also tried to use <?php echo $result["1"][$i]; ?> , this resulted in only having a single part of the String (which was something i learned thanks to this =D) So I would like to know the following: How to SELECT ALL the messages IN that table that are directed at ME? I want multiple columns selected, and echo'ed. I would love to thank anyone who answers this question in Advance =D
  17. Hello there, I think you want to know how your site looks on different resolutions? In Chrome, you can press F12 (followed by Ctr+Shift+M) to watch any site in a different resolution (you can even simulate certain handheld devices).
  18. I think you want to use an IFrame. <iframe src="http://villordsutch.tumblr.com/"></iframe> Tutorial: https://www.w3schools.com/tags/tag_iframe.asp
  19. Thankyou everyone. I got things working now =D Uploading files was new to me =D You all deserve a cookie!
  20. Hello everyone i have a few PHP questions. First one: How can I say that for each image in a specified folder, it has to place that image? I have 10 images in the gallery folder (tomorow it can be 12). How do i tell my code to place an <img src="filename"> for each image? Second question: When displaying something that a user posted (example: guestbook). How can i allow ENTERS to be displayed when getting the data from the database? It always skips the enters. Third question: How exactly can i allow users to upload a file to a certain folder (must be a jpg file). The name of the image will be modified, and it should be resized to 200 kilobyte. Fourth question: Can i change certain parts of the text i get from the database (example: ":)" and change it to something differently? Say: "<img src="smily.png>"? Thanks in advance for the answers =D
  21. Hello everyone. I want to create a system where people can post things. Like on this forum. But i am wondering. Should i save long text messages as one big and long string. Or should i use a different method? If you suggest a different method a link to a tutorial would be a big help n.n Thanks in advance kind mis or mister
  22. All i want is a simple border image as my HR. HTML should be: <hr> Simple enough CSS should be: ? Quite simple: ONE image as a SINGLE line, 100% height, and repeating horizontally.. This should not be quite difficult to do. But no matter what i try, the CSS is always doing things that i do not want it to do. So how would your CSS look like in order to achieve this task? I give you my sincere gratitude in advance!
  23. To answer the question: yes, that is certainly possible. How to do it: Depends on your HTML and CSS. Providing us this information would be very helpfull. Have you tried validating your CSS?
  24. It sounds like you want a drop down menu. You can find a tutorial here: https://www.w3schools.com/css/css_dropdowns.asp
  25. There is no CSS for a screen larger than 470 pixels if i see this correctly. You are also working with inline css and obsolete table sub tags such as border="0" cellspacing="0" cellpadding="0". CSS gets read like this: Use inline CSS Else Use the css in the head Else Use the css in the linked file. Maybe that is what is creating the conflict?