Jump to content

Sunamena

Members
  • Posts

    85
  • Joined

  • Last visited

Recent Profile Visitors

5,532 profile views

Sunamena's Achievements

Newbie

Newbie (1/7)

3

Reputation

  1. So you see price, meaning it probably did not read the ID. Try the following. Reload the page by using control+F5. This reloads your stored Javascript code. Then press F12 (Google chrome) and look for errors in the Console. Let us know how this worked.
  2. Sunamena

    HTML > CSS

    You can indeed use a flexbox In very short: table { width: 100%; } table tr { display: flex; } table tr td { flex 1; } In more detail: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
  3. Sunamena

    Background Image

    I have a very large background image. It should not fill the screen, usually the image is larger than the screen. However, the image is displayed from the top left, and the right and bottom parts are left out. However, it should be the top right that is left out. How can I achieve this?
  4. Your textarea and email dont have a name (HTML). Could that cause a problem?
  5. I am currently on my mobile device so i can not check your code but i always jump to the part under guided. Are you sure the ID is at the correct place? And did you try to validate your code? Very handy to see you forgot something. https://validator.w3.org
  6. Image 2 is the closest to the last one (the example i presume?). The left div does not need any margin. Try adding: margin: 0; And the right div would need: vertical-align: top;
  7. I am not a big fan of Bootstrap, but i think this is what you are looking for: Example: https://www.w3schools.com/bootstrap/bootstrap_affix.asp Note that this is achieved by using JavaScript. You actually change the class after scrolling down.
  8. You can try to assign a clear propperty. Like in this example: https://www.w3schools.com/css/css_float.asp I think the "try it" tackles a problem like the one you are having right now. If it still doesn't work, be sure to reply
  9. I failed to find an example of something specific i am looking for. This is what i want: <img src="a.jpg" id="1"> <img src="a.jpg" id="2"> <img src="a.jpg" id="3"> <img src="b.jpg" id="dragable-1"> <img src="b.jpg" id="dragable-2"> When a draggable image (as seen in the ID), gets dragged onto another image i want this to happen: <a href="mylink.php?draggable=IDDRAGGABLE1&to=IDOFTHEIMMAGEITGOTDROPPEDINTO"></a> Can i find any tutorial on this? Is this difficult? Thanks in advance =D
  10. Sunamena

    Select and array

    Thankyou very much for your reply! Well, I will stick with PDO then. I managed to find a solution to make it work with PDO (and I am happy with that ). I did get error messages, but not anymore. I think the problem was on my end (or i was not patient enough). At the top of my document, to keep it organised i check all my input from the post. For the password i hash with sha1. Should i adopt using password_hash instead?
  11. Sunamena

    Select and array

    Hello everyone I have a small problem with my code. I will show the most important parts of it and hope you guys can assist me This is my code: $sql = "SELECT * FROM brusers WHERE userName = '$userName' AND password = '$wachtwoord'"; // Vraag alle resultaten op $stmt = $con -> prepare($sql); $deelStap=mysqli_query($con,$sql); $result=mysqli_fetch_all($deelStap,MYSQLI_NUM); // of: $result=mysqli_fetch_all($deelStap,MYSQLI_NUM); print_r($deelStap); This is the print_r: mysqli_result Object ( [current_field] => 0 [field_count] => 12 [lengths] => [num_rows] => 0 [type] => 0 ) When i print_r($result) i get an empty array. How do i get $result as an array? I am used to using PDO (i like it alot), my PDO code works fine on my localhost: -- Connect with databasw with PDO $db = new PDO('mysql:host=localhost:3307;dbname=handikrap', 'root', 'usbw'); $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); --- code $sql = "SELECT userID, userName, type, ban, laatstIngelogd, inlogPogingen FROM users WHERE userName = :userName AND passWord = :wachtwoord"; $stmt = $db -> prepare($sql); $stmt -> bindParam(':userName', $userName, PDO::PARAM_INT); $stmt -> bindParam(':wachtwoord', $wachtwoord, PDO::PARAM_INT); $userName = htmlspecialchars($_POST["userName"]); $wachtwoord = htmlspecialchars(sha1($_POST["wachtwoord"])); $stmt -> execute(); $row = $stmt -> fetch(PDO::FETCH_NUM); but seems to not be supported on the webhost of one.com. Or did i do something wrong? Should i stick with PDO or move on to mySqli? They use MariaDB on one.com. Thanks in advance
  12. 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?
  13. 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?
  14. Thanks. This problem has been solved =D
×
×
  • Create New...