Extraction from MySQL of the mass to variable



  • There's a code for the cross-section. How do you go to the variable $url to remove the element from the mass (url) that was painted in the picture to make a retro-reflect on this urn?

    <?php
    mysql_connect("localhost", "root", "") or die(mysql_error()) ;
    mysql_select_db("dbname") or die(mysql_error()) ;
    if (empty($_GET['id'])) {
            header('HTTP/1.1 404 Not found');
            die();
        } else {
     $id = mysql_real_escape_string($_GET['id']);
            mysql_query("update lbsplash set click = click + 1 where id = '$id'");
    
        //$url = выбрать из массива элемент 'product url', где id='$id'
        header('Location: '.$url);
    

    }
    ?>

    введите сюда описание изображения



  • $result = mysql_query("select data from lbsplash where id ='$id'");
    $row = mysql_fetch_assoc($result);
    $json_data = $row['data'];
    $data = json_decode($json_data, true);
    $url = $data['product'];
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2