Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. <?php error_reporting(E_ALL); ini_set('display_errors', true); $dbname='in_dein_fall_test'; $json_datei='https://api.truckyapp.com/v2/traffic/servers'; $mysqli=mysqli_connect('localhost', 'root', '', 'db'); if (mysqli_connect_errno()) die ("Connect failed: " . mysqli_connect_error()); mysqli_set_charset($mysqli, "utf8"); // /* von hier auskommentieren nach ersten aufruf // bis hier auskkommentieren oder löschen*/ $query = "UPDATE `$dbname` SET (`name`, `url`, `short`, `game`) VALUES ('%s','%s','%s', '%s')"; $json = json_decode(file_get_contents($json_datei),true); $queries = array(); foreach ($json['response'] as $data){ $name=mysqli_real_escape_string($mysqli, $data['name']); $url=mysqli_real_escape_string($mysqli, $data['url']); $short=mysqli_real_escape_string($mysqli, $data['short']); $game=mysqli_real_escape_string($mysqli, $data['game']); $queries[] = sprintf($query, $name, $url, $short, $game); } $menge=count($queries); if (mysqli_multi_query($mysqli, implode(";", $queries))){ echo "$menge Datensätze erfolgreich importiert<br>"; }else{ echo "errors<br>"; } echo ""; $mysqli->close(); ?> https://prnt.sc/sqjsnc
  3. Yesterday
  4. Hello, I use this code to move(sortable) the rows of my table. I have a problem, he apply the js code to all the table!!! Even without tbody! Do you know why? thank you a lot!!! <div style="overflow-x: auto;"> <table id="table_id" style="overflow-x: auto;"> <thead> <tr class="ui-state-default"> <th>1</th> <th>2</th> <th>3</th> <th>4</th> <th>5</th> <th>6</th> <th>7</th> <th>8</th> <th>Position</th> </tr> </thead> <tbody> <tr> <td contenteditable='true'>1</td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'>1</td> </tr> <tr> <td contenteditable='true'>2</td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'>2</td> </tr> <tr> <td contenteditable='true'></td> <td contenteditable='true'>3</td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'></td> <td contenteditable='true'>3</td> </tr> </tbody> </table> $("table tbody").sortable({ update : function(event, ui) { $(this).children().each(function(index) { $(this).find('td').last().html(index + 1) }); } });
  5. Lisa67000

    I'm new!

    Hi everybody! I'm there. I love w3schools, it's so great and full of knowledge. Actually, I'm working on a private project in HTML/CSS/JS/SQL. Hope to share with you!! xxx
  6. What error are you getting and what does your new code look like?
  7. You have to determine why it did not work and then solve that problem.
  8. Yes the problem is I tried it with update but that does not work
  9. That code looks valid, but it is different than the code you posted in this topic. It is an INSERT query, so it will only ever create new records and not change existing ones.
  10. The correct question is in the previous post. I will delete this one. Apolozige for that and I will appreciate your help. Thank you dsonesuk
  11. https://prnt.sc/sq96pa . https://prnt.sc/sq96ug whats wrong
  12. Where is the initial call the run the function? You have the the function with a setTimeout to run it again! but there no calling of function to start the process.
  13. Look carefully for differences between your SQL and the SQL Syntax shown in this tutorial page: https://www.w3schools.com/php/php_mysql_insert.asp
  14. Hello folks, My simple code bellow is not working !!!☹️. The value for <div "X0"> is updated only once. The value for <div "X2"> is never updated. I want to have both X0 and X2 updated every second.... Any suggestion ? Thanks a lot. Antonio... <html><head> <script src="http://code.jquery.com/jquery-latest.js"> </script><script> $(document).ready(function update(){ $('#X0').load("urlforX0"); $('#X2').load("urlforX2"); setTimeout(update,1000);} ); </script></head> <body> <div "X0"></div> <div "x2"></div> <script>update();</script> </body> </html>
  15. I am really not good at this ... Below is my fumbling steps to a make a website mostly using W3.CSS. But I have run into some things that I do not know how to solve. 1, There is a border under the navbar and over the footer. The border is a few px shorter than the area (which is how I want it). But I don't understand why the border at footer right doesn't shrink like the navbar right does. 2, I have a logo on the same line as the navbar. I do not want the navbar to jump under the logo when getting too close, I want it to turn into a hamburger earlier. How do I change when the turn should happen? 3, Would it be possible to have a step in between? Today the navbar is an icon with text and then it turns to a hamburger. How do I make it icon with text -> icon-> hamburger when shrinking? I tried but it doesn't work, that is the area that I marked out with <"-- and so on. Another problem with this "try" is that the icons are on a separate row so the navbar is thicker. This is not not most important to fix, it would just be nice ... 4, Can I make the text in the navbar change color when hover? I do not want the whole button to change color, just the text. I tried this in the css but it does not work: nav a:hover{ color: rgba(250, 160, 20); } Here is the HTML (there is also a CSS but it doesn't add much to these problems, just colors etc): <html> <head> <meta charset="utf-8"> <title>Testing-testing</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto"> <link rel="stylesheet" href="css/styles3.css"> </head> <!-- BACKGROUND --> <body class="w3-content w3-dark-grey" > <!-- HOLDER --> <div class="w3-black" style="max-width: 1024px"> <!-- NAVIGATION --> <div class="w3-top"> <!-- TOP IMAGE --> <div class="w3-display-container"> <img src="img/bg_header1536_3_2.jpg" style="max-width:980px"alt="Header image"> </div> <!-- BAR --> <nav class="w3-container"> <div class="w3-bar w3-border-bottom" style="max-width:944px"> <img src="img/logo_w_250.png" style="padding-bottom: 3px;" alt="Logo 250px wide"></img> <span> <div id="nav1" class="w3-right" style="max-width:944px"> <a href="home" class="w3-bar-item w3-button w3-hide-small w3-hover-black"><span id="icon" class="fa fa-home"></span> Home</a> <a href="products" class="w3-bar-item w3-button w3-hide-small w3-hover-black"><span id="icon" class="fa fa-bolt"></span> Products</a> <a href="downloads" class="w3-bar-item w3-button w3-hide-small w3-hover-black"><span id="icon" class="fa fa-download"></span> Downloads</a> <a href="signin" class="w3-bar-item w3-button w3-hide-small w3-hover-black"><span id="icon" class="fa fa-sign-in"></span> Sign in</a> <a href="contact" class="w3-bar-item w3-button w3-hide-small w3-hover-black"><span id="icon" class="fa fa-envelope"></span> Contact</a> </div> <!-- <div id="nav2" class="w3-right" style="max-width:500px"> <a href="home" class="w3-bar-item w3-button w3-hide-small hide-large w3-hover-black"><span id="icon" class="fa fa-home"></span> </a> <a href="products" class="w3-bar-item w3-button w3-hide-small hide-large w3-hover-black"><span id="icon" class="fa fa-bolt"></span> </a> <a href="downloads" class="w3-bar-item w3-button w3-hide-small hide-large w3-hover-black"><span id="icon" class="fa fa-download"></span> </a> <a href="signin" class="w3-bar-item w3-button w3-hide-small hide-large w3-hover-black"><span id="icon" class="fa fa-sign-in"></span> </a> <a href="contact" class="w3-bar-item w3-button w3-hide-small hide-large w3-hover-black"><span id="icon" class="fa fa-envelope"></span> </a> </div> --> <!-- BURGER --> <a href="javascript:void(0)" class="w3-bar-item w3-button w3-right w3-hide-medium w3-hide-large w3-hover-black" onclick="myFunction()">☰</a> </span> </div> <div id="burger" class="w3-bar-block w3-black w3-right w3-hide w3-hide-large"> <a href="home" class="w3-bar-item w3-dark-grey w3-button w3-hover-black">Home</a> <a href="products" class="w3-bar-item w3-dark-grey w3-button w3-hover-black">Products</a> <a href="downloads" class="w3-bar-item w3-dark-grey w3-button w3-hover-blacky">Downloads</a> <a href="signin" class="w3-bar-item w3-dark-grey w3-button w3-hover-black">Sign in</a> <a href="contact" class="w3-bar-item w3-dark-grey w3-button w3-hover-blacky">Contact</a> </div> <!-- <script> function myFunction() { var x = document.getElementById("nav2"); if (x.className.indexOf("w3-show") == -1) { x.className += " w3-show"; } else { x.className = x.className.replace("w3-show", ""); } } </script> --> <script> function myFunction() { var x = document.getElementById("burger"); if (x.className.indexOf("w3-show") == -1) { x.className += " w3-show"; } else { x.className = x.className.replace("w3-show", ""); } } </script> </nav> </div> <!-- EMPTY BAR BEHIND NAVIGATION --> <div id="behind" class="w3-bar"style="margin:100px"> </div> <!-- SECTION 1 --> <div class="section"> <div class="w3-container"> <h1>Hello World!</h1> </div> </div> <!-- FOOTER --> <footer class="w3-bar w3-margin w3-border-top w3-center" style="max-width:944px"> <h6>© 2020 Testing-testing Systems</h6> </footer> </div> </body> </html> Thanks for any help you can provide!
  16. I ve already read through but I do not come across the problem
  17. Sherin

    SQL Query - Conditions

    You can try this query select column_name1,column_name2 ,column_name3 where column_name3 = 23 and Val=41; i will this query is help for you if you any query this query related then you ask me.
  18. First of all there is a css style given to <button class="dropbtn">meny</button>. In which there is the text color is white and back color is black. And given the padding. There is also css style is given to dropdown and dropdown-content. Now this class .dropdown-content a { is given for the anchor tag style. .dropdown-content a:hover {background-color: white;} when you take your cursor over the anchor tag it's back color will be white. .dropdown:hover .dropdown-content {display: block;} same as here, when hover over the dropdown it'll display in the block. .dropdown:hover .dropbtn {background-color: grey;} and when you hover over the dropdown button it's back color will be grey. I hope you'll understand it.😅 If there is any question to ask then free to ask me. Thanks!
  19. Hii, There is just writing problem. You just use " href " instead of " ref ". <li class="itemnav"><a href="index.html">inicio</a></li> Now it'll work 🙂. Thanks!
  20. Last week
  21. It seams basic but I did not have success to update two different <div> at same time, every second .... Here is my code: <script src='http://code.jquery.com/jquery-latest.js'></script> <script> $(document).ready(function update(){$('#X0').load('V');setTimeout(update,2500);});</script> To be update: <div id="X0">will be updated</div> <div id="X1">will be updated too</div> The server response to get/V: <div id="X0">new x0 content</div><div id="X1">new x1 content</div> I have tried to make a lot of different changes over function update() but none of them worked... Thanks for any help. Antonio
  22. It works now. I had called $conn->close(); immediately after establishing it. It was to deal with an earlier error, although I do not remember what.
  23. It's best you go through the MySQL section of the PHP tutorial and learn how to do it. You won't learn if you don't go through the effort and next time you run into a problem you'll just be asking other people to write the code for you again.
  24. Could they put me in the code I just do not know exactly how I do it so? $query = "INSERT INTO `$dbname` VALUES (`name`, `url`, `short`, `game`) ON DUPLICATE KEY UPDATE `name` = '%s', `url` = '%s', `short` = '%s', `game` = '%s'";
  25. You're mixing object-oriented mysqli with procedural mysql and your INSERT query is missing the VALUES section.
  26. <?php error_reporting(E_ALL); ini_set('display_errors', true); $dbname='in_dein_fall_test'; $json_datei='https://api.truckyapp.com/v2/traffic/servers'; $mysqli=mysqli_connect('localhost', 'root', '', 'db'); if (mysqli_connect_errno()) die ("Connect failed: " . mysqli_connect_error()); mysqli_set_charset($mysqli, "utf8"); // /* von hier auskommentieren nach ersten aufruf // bis hier auskkommentieren oder löschen*/ $query = "INSERT INTO `$dbname` (`name`, `url`, `short`, `game`) ON DUPLICATE KEY UPDATE `name` = '%s', `url` = '%s', `short` = '%s', `game` = '%s'"; $json = json_decode(file_get_contents($json_datei),true); $queries = array(); foreach ($json['response'] as $data){ $name=mysqli_real_escape_string($mysqli, $data['name']); $url=mysqli_real_escape_string($mysqli, $data['url']); $short=mysqli_real_escape_string($mysqli, $data['short']); $game=mysqli_real_escape_string($mysqli, $data['game']); $queries[] = sprintf($query, $name, $url, $short, $game); } $menge=count($queries); if (mysqli_multi_query($mysqli, implode(";", $queries))){ echo "$menge Datensätze erfolgreich importiert<br>"; }else{ echo "Irgendwelche errors<br>"; } echo ""; $mysqli->close(); if ($mysqli -> connect_errno) { echo "Failed to connect to MySQL: " . $mysqli -> connect_error; exit(); } // Perform a query, check for error if (!$mysqli -> query("INSERT INTO `in_dein_fall_test` (name) VALUES ('Glenn')")) { echo("Error description: " . $mysqli -> error); } ?> Thats the code
  27. Without seeing your code I can't tell what's wrong but it looks like you're probably mixing up the procedural and object-oriented versions of the functions.
  1. Load more activity
×
×
  • Create New...