Jump to content

Elton

Members
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Elton

  • Rank
    Newbie
  1. $query = "UPDATE `$dbname` SET name='%s', url='%s', short='%s', game='%s' WHERE name;";
  2. https://prnt.sc/sqsm7i it seems like it works partially but it imports incorrectly
  3. $query = "UPDATE `$dbname` SET name=%s, url=%s, short=%s, game=%s";
  4. <?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 = arr
  5. Yes the problem is I tried it with update but that does not work
  6. https://prnt.sc/sq96pa . https://prnt.sc/sq96ug whats wrong
  7. I ve already read through but I do not come across the problem
  8. 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'";
  9. <?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 =
  10. if I do it so then come still error https://prnt.sc/splbgj $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[] = sprin
  11. It doesn't really matter, does it? but there are still mistakes https://prnt.sc/spkco6
  12. $query = "INSERT INTO `$dbname` (`name`, `url`, `short`, `game`) VALUES ('%s','%s','%s', '%s') ON DUPLICATE KEY UPDATE `name` = '%s', `url` = '%s', `short` = '%s', `game` = '%s'"; I have tried it with this code but it does not work
×
×
  • Create New...