'Why is this "illegal url" error appearing when running flutter doctor?

I have installed a new version of flutter in my macOS. But when trying to run flutter doctor I get this

Downloading Dart SDK from Flutter engine <<<<<<< HEAD
05e680e202af9a92461070cb2d9982acad46c83c
=======
d3ea636dc5d16b56819f3266241e1f708979c233
>>>>>>> 18116933e77adc82f80866c928266a5b4f1ed645...
curl: (3) URL using bad/illegal format or missing URL

Failed to retrieve the Dart SDK from: https://storage.googleapis.com/flutter_infra_release/flutter/<<<<<<< HEAD
05e680e202af9a92461070cb2d9982acad46c83c
=======
d3ea636dc5d16b56819f3266241e1f708979c233
>>>>>>> 18116933e77adc82f80866c928266a5b4f1ed645/dart-sdk-darwin-x64.zip
If you're located in China, please see this page:
  https://flutter.dev/community/china

Is there a known fix for this? I have looked for an answer, but they're mostly targeted towards Windows.



Solution 1:[1]

navigate to git folder

in git console: (be aware local changes are dismissed!)

git fetch --all

git reset --hard origin/master

Solution 2:[2]

Looks like you need to execute the $sql query... see the modified code below for how to execute a mysqli sql update query.

<?php
    //mysql credentials
    $mysql_host = "buythosecarscom.fatcowmysql.com";
    $mysql_username = "[secret]";
    $mysql_password = "[secret]";
    $mysql_database = "buythatcar";
    
//header("Location: survey_two.html");

    $u_q1 = filter_var($_POST["question_1"], FILTER_SANITIZE_STRING); //set PHP variables like this so we can use them anywhere in code below
    $u_q2 = filter_var($_POST["question_2"], FILTER_SANITIZE_STRING);
    $u_q3 = filter_var($_POST["question_3"], FILTER_SANITIZE_STRING);
        $u_q4 = filter_var($_POST["question_4"], FILTER_SANITIZE_STRING);
        $u_q4b = filter_var($_POST["question_4b"], FILTER_SANITIZE_STRING);
        $u_q5 = filter_var($_POST["question_5"], FILTER_SANITIZE_STRING);        
        $u_q6 = filter_var($_POST["question_6"], FILTER_SANITIZE_STRING);
        $u_q7 = filter_var($_POST["question_7"], FILTER_SANITIZE_STRING);
        $u_q8 = filter_var($_POST["question_8"], FILTER_SANITIZE_STRING);
        $u_q9 = filter_var($_POST["question_9"], FILTER_SANITIZE_STRING);
        $u_q10 = filter_var($_POST["question_10"], FILTER_SANITIZE_STRING);

    //Open a new connection to the MySQL server
    $mysqli = new mysqli($mysql_host, $mysql_username, $mysql_password, $mysql_database);
    
    //Output any connection error
    if ($mysqli->connect_error) {
        die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
    }   
    
    $statement = $mysqli->prepare("INSERT INTO users_data (question_1, question_2, question_3, question_4, question_4b, question_5, question_6, question_7, question_8, question_9, question_10) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); //prepare sql insert query
    //bind parameters for markers, where (s = string, i = integer, d = double,  b = blob)
    $statement->bind_param('sssssssssss', $u_q1, $u_q2, $u_q3, $u_q4, $u_q4b, $u_q5, $u_q6, $u_q7, $u_q8,  $u_q9, $u_q10); //bind values and execute insert query
    

    if($statement->execute()){
       $last_id = $mysqli -> insert_id;
       echo "New record has id: " . $last_id;
       print "Hello " . $mysqli-> insert_id . "!, your message has been saved!";
       print "Hello  $last_id";
      
       $sql = "UPDATE field_numbers SET field_num= '$last_id' WHERE id=1";

       if($mysqli->query($sql) === TRUE) {
            echo "cool";
            }else{
       echo "awful: " . $mysqli->error;
         }
      }else{
        print $mysqli->error; //show mysql error if any
    }
?>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user19187758
Solution 2 PocketLoan