douna1892 2015-03-23 13:49
浏览 65
已采纳

为什么我不能合并这两个脚本

I have these two scripts. One is an mysql INSERT INTO a DATABASE.

The second created a new directory and uploads upto 5 images into the newly created folder.

They both work as seperate entities but when i try and combine them it will not insert the information into the database. There must be something conflicting that I just cant see.

Here is the upload files code that works:

<?php



// Assigning $_POSTS to variables


//login details

$username_entry = $_POST['username_entry'];
$password_entry = $_POST['password_entry'];

//!login details

//contact details

$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$tel = $_POST['tel'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$address3 = $_POST['address3'];
$address4 = $_POST['address4'];
$postcode = $_POST['postcode'];
$facebook = $_POST['facebook'];
$twitter = $_POST['twitter'];
$whatareyou = $_POST['whatareyou'];
$business_description = $_POST['business_description'];
$website = $_POST['website'];

//!contact details

//opening times

$opening_monday_from = $_POST ['opening_monday_from'];
$opening_monday_to = $_POST ['opening_monday_to'];

$opening_tuesday_from = $_POST ['opening_tuesday_from'];
$opening_tuesday_to = $_POST ['opening_tuesday_to'];

$opening_wednesday_from = $_POST ['opening_wednesday_from'];
$opening_wednesday_to = $_POST ['opening_wednesday_to'];

$opening_thursday_from = $_POST ['opening_thursday_from'];
$opening_thursday_to = $_POST ['opening_thursday_to'];

$opening_friday_from = $_POST ['opening_friday_from'];
$opening_friday_to = $_POST ['opening_friday_to'];

$opening_saturday_from = $_POST ['opening_saturday_from'];
$opening_saturday_to = $_POST ['opening_saturday_to'];

$opening_sunday_from = $_POST ['opening_sunday_from'];
$opening_sunday_to = $_POST ['opening_sunday_to'];



//!opening times


// !Assigning $_POSTS to varaiables

// DataBase credentials

$user = 'root';
$password = 'root';
$db = 'welcometowarwick';
$host = 'localhost';
$port = 8889;

//! DataBase credentials

// Connect to DataBase

$link = mysqli_init();
$success = mysqli_real_connect(
   $link, 
   $host, 
   $user, 
   $password, 
   $db,
   $port
);

//! Connect to DataBase


$directoryPath = "user_images/".$username_entry;
mkdir($directoryPath, 0777, true);



if (isset($_FILES['upload']) === true) {
  $files = $_FILES['upload'];

  for($x = 0; $x < count($files['name']); $x++) {
    $name = $files['name'][$x];
    $tmp_name = $files['tmp_name'][$x];

    move_uploaded_file($tmp_name, "user_images/{$username_entry}/{$name}");

  //echo '<pre>', print_r($files['name'][0], true), '</pre>';

    $image_upload1 = ($files['name'][0]);
    $image_upload2 = ($files['name'][1]);
    $image_upload3 = ($files['name'][2]);
    $image_upload4 = ($files['name'][3]);
    $image_upload5 = ($files['name'][4]);

  }


  $insert_upload1 = "user_images/$username_entry/$image_upload1";
  $insert_upload2 = "user_images/$username_entry/$image_upload2";
  $insert_upload3 = "user_images/$username_entry/$image_upload3";
  $insert_upload4 = "user_images/$username_entry/$image_upload4";
  $insert_upload5 = "user_images/$username_entry/$image_upload5";

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];

  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);


  $insertSQL = sprintf("INSERT INTO ofnissenisub321 (timestamp, username, password, business_name, address1, address2, address3, postcode, email, website, Facebook, twitter, linkedin, opening_monday_from, opening_monday_to, opening_tuesday_from, opening_tuesday_to, opening_wednesday_from, opening_wednesday_to, opening_thursday_from, opening_friday_from, opening_friday_to, opening_saturday_from, opening_saturday_from, opening_saturday_to, opening_sunday_from, opening_sunday_to, business_type, business_description, managers_message, image_1, image_2, image_3, image_4, image_5) VALUES (NOW(), %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['username_entry'], "text"),
                       GetSQLValueString($_POST['password_entry'], "text"),
                       GetSQLValueString($_POST['business_name'], "text"),
                       GetSQLValueString($_POST['address1'], "text"),
                       GetSQLValueString($_POST['address2'], "text"),
                       GetSQLValueString($_POST['address3'], "text"),
                       GetSQLValueString($_POST['postcode'], "text"),
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString($_POST['website'], "text"),
                       GetSQLValueString($_POST['facebook'], "text"),
                       GetSQLValueString($_POST['twitter'], "text"),
                       GetSQLValueString($_POST['linkedin'], "text"),
                       GetSQLValueString($_POST['opening_monday_from'], "text"),
                       GetSQLValueString($_POST['opening_monday_to'], "text"),
                       GetSQLValueString($_POST['opening_tuesday_from'], "text"),
                       GetSQLValueString($_POST['opening_tuesday_to'], "text"),
                       GetSQLValueString($_POST['opening_wednesday_from'], "text"),
                       GetSQLValueString($_POST['opening_wednesday_to'], "text"),
                       GetSQLValueString($_POST['opening_thursday_from'], "text"),
                       GetSQLValueString($_POST['opening_thursday_to'], "text"),
                       GetSQLValueString($_POST['opening_friday_from'], "text"),
                       GetSQLValueString($_POST['opening_friday_to'], "text"),
                       GetSQLValueString($_POST['opening_saturday_from'], "text"),
                       GetSQLValueString($_POST['opening_saturday_to'], "text"),
                       GetSQLValueString($_POST['opening_sunday_from'], "text"),
                       GetSQLValueString($_POST['opening_sunday_to'], "text"),
                       GetSQLValueString($_POST['business_type'], "text"),
                       GetSQLValueString($_POST['business_description'], "text"),
                       GetSQLValueString($_POST['managers_message'], "text"),
             GetSQLValueString($insert_upload1, "text"),
             GetSQLValueString($insert_upload2, "text"),
             GetSQLValueString($insert_upload3, "text"),
             GetSQLValueString($insert_upload4, "text"),
             GetSQLValueString($insert_upload5, "text"));

  mysql_select_db($database_w2w, $w2w);
  $Result1 = mysql_query($insertSQL, $w2w) or die(mysql_error());  }






if (mysqli_query($link, $sql)) {
    echo "New record created successfully $username_entry";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($link);
}

mysqli_close($link);

//! MySQLi insertInto
?> 


?>

And here is the INSERT code, again, works:

<?php



// Assigning $_POSTS to variables


//login details

$username_entry = $_POST['username_entry'];
$password_entry = $_POST['password_entry'];

//!login details

//contact details

$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$tel = $_POST['tel'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$address3 = $_POST['address3'];
$address4 = $_POST['address4'];
$postcode = $_POST['postcode'];
$facebook = $_POST['facebook'];
$twitter = $_POST['twitter'];
$whatareyou = $_POST['whatareyou'];
$business_description = $_POST['business_description'];
$website = $_POST['website'];

//!contact details

//opening times

$opening_monday_from = $_POST ['opening_monday_from'];
$opening_monday_to = $_POST ['opening_monday_to'];

$opening_tuesday_from = $_POST ['opening_tuesday_from'];
$opening_tuesday_to = $_POST ['opening_tuesday_to'];

$opening_wednesday_from = $_POST ['opening_wednesday_from'];
$opening_wednesday_to = $_POST ['opening_wednesday_to'];

$opening_thursday_from = $_POST ['opening_thursday_from'];
$opening_thursday_to = $_POST ['opening_thursday_to'];

$opening_friday_from = $_POST ['opening_friday_from'];
$opening_friday_to = $_POST ['opening_friday_to'];

$opening_saturday_from = $_POST ['opening_saturday_from'];
$opening_saturday_to = $_POST ['opening_saturday_to'];

$opening_sunday_from = $_POST ['opening_sunday_from'];
$opening_sunday_to = $_POST ['opening_sunday_to'];



//!opening times


// !Assigning $_POSTS to varaiables

// DataBase credentials

$user = 'root';
$password = 'root';
$db = 'welcometowarwick';
$host = 'localhost';
$port = 8889;

//! DataBase credentials

// Connect to DataBase

$link = mysqli_init();
$success = mysqli_real_connect(
   $link, 
   $host, 
   $user, 
   $password, 
   $db,
   $port
);

//! Connect to DataBase





//MySQLi insertInto

$sql = "INSERT INTO business_info 
(
username,
password,
email,
email2,
tel,
address1,
address2,
address3,
address4,
postcode,
facebook,
twitter,
opening_monday_to,
opening_monday_from,
opening_tuesday_to,
opening_tuesday_from,
opening_wednesday_to,
opening_wednesday_from,
opening_thursday_to,
opening_thursday_from,
opening_friday_to,
opening_friday_from,
opening_saturday_to,
opening_saturday_from,
opening_sunday_to,
opening_sunday_from,
whatareyou,
business_description,
image1,
image2,
image3,
image4,
image5,
website


) 
VALUES 
(
'$username_entry',
'$password_entry',
'$email1',
'$email2',
'$tel', 
'$address1',
'$address2',
'$address3',
'$address4',
'$postcode',
'$facebook',
'$twitter',
'$opening_monday_to',
'$opening_monday_from',
'$opening_tuesday_to',
'$opening_tuesday_from',
'$opening_wednesday_to',
'$opening_wednesday_from',
'$opening_thursday_to',
'$opening_thursday_from',
'$opening_friday_to',
'$opening_friday_from',
'$opening_saturday_to',
'$opening_saturday_from',
'$opening_sunday_to',
'$opening_sunday_from',
'$whatareyou',
'$business_description',
'$image1',
'$image2',
'$image3',
'$image4',
'$image5',
'$website'
)";



if (mysqli_query($link, $sql)) {
    echo "New record created successfully $username_entry";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($link);
}

mysqli_close($link);

//! MySQLi insertInto
?> 

I have tried different combinations of these two codes (which is why there are irrelevent bits in the UPLOAD script. However both just tested seperately and both do the jobs required. I just cant get them to both run at the same time.

Can anyone shed some light on this please. Thanks :)

Basically I just want to add the mkdir upload script into the INSERT script without disrupting it....

******EDIT HERE IS THE SCRIPT I CANNOT MAKE WORK******

<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);

// Assigning $_POSTS to variables


//login details

$username_entry = $_POST['username_entry'];
$password_entry = $_POST['password_entry'];

//!login details

//contact details

$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$tel = $_POST['tel'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$address3 = $_POST['address3'];
$address4 = $_POST['address4'];
$postcode = $_POST['postcode'];
$facebook = $_POST['facebook'];
$twitter = $_POST['twitter'];
$whatareyou = $_POST['whatareyou'];
$business_description = $_POST['business_description'];
$website = $_POST['website'];

//!contact details

//opening times

$opening_monday_from = $_POST ['opening_monday_from'];
$opening_monday_to = $_POST ['opening_monday_to'];

$opening_tuesday_from = $_POST ['opening_tuesday_from'];
$opening_tuesday_to = $_POST ['opening_tuesday_to'];

$opening_wednesday_from = $_POST ['opening_wednesday_from'];
$opening_wednesday_to = $_POST ['opening_wednesday_to'];

$opening_thursday_from = $_POST ['opening_thursday_from'];
$opening_thursday_to = $_POST ['opening_thursday_to'];

$opening_friday_from = $_POST ['opening_friday_from'];
$opening_friday_to = $_POST ['opening_friday_to'];

$opening_saturday_from = $_POST ['opening_saturday_from'];
$opening_saturday_to = $_POST ['opening_saturday_to'];

$opening_sunday_from = $_POST ['opening_sunday_from'];
$opening_sunday_to = $_POST ['opening_sunday_to'];



//!opening times


// !Assigning $_POSTS to varaiables

// DataBase credentials

$user = 'root';
$password = 'root';
$db = 'welcometowarwick';
$host = 'localhost';
$port = 8889;

//! DataBase credentials

// Connect to DataBase

$link = mysqli_init();
$success = mysqli_real_connect(
   $link, 
   $host, 
   $user, 
   $password, 
   $db,
   $port
);

//! Connect to DataBase


$directoryPath = "user_images/".$username_entry;

mkdir($directoryPath, 0777, true);



if (isset($_FILES['upload']) === true) {
  $files = $_FILES['upload'];

  for($x = 0; $x < count($files['name']); $x++) {
    $name = $files['name'][$x];
    $tmp_name = $files['tmp_name'][$x];

    move_uploaded_file($tmp_name, "user_images/{$username_entry}/{$name}");

  //echo '<pre>', print_r($files['name'][0], true), '</pre>';

    $image_upload1 = ($files['name'][0]);
    $image_upload2 = ($files['name'][1]);
    $image_upload3 = ($files['name'][2]);
    $image_upload4 = ($files['name'][3]);
    $image_upload5 = ($files['name'][4]);

  }


  $insert_upload1 = "user_images/$username_entry/$image_upload1";
  $insert_upload2 = "user_images/$username_entry/$image_upload2";
  $insert_upload3 = "user_images/$username_entry/$image_upload3";
  $insert_upload4 = "user_images/$username_entry/$image_upload4";
  $insert_upload5 = "user_images/$username_entry/$image_upload5";

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];

  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);


  $insertSQL = sprintf("INSERT INTO ofnissenisub321 (timestamp, username, password, business_name, address1, address2, address3, postcode, email, website, Facebook, twitter, linkedin, opening_monday_from, opening_monday_to, opening_tuesday_from, opening_tuesday_to, opening_wednesday_from, opening_wednesday_to, opening_thursday_from, opening_friday_from, opening_friday_to, opening_saturday_from, opening_saturday_from, opening_saturday_to, opening_sunday_from, opening_sunday_to, business_type, business_description, managers_message, image_1, image_2, image_3, image_4, image_5) VALUES (NOW(), %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['username_entry'], "text"),
                       GetSQLValueString($_POST['password_entry'], "text"),
                       GetSQLValueString($_POST['business_name'], "text"),
                       GetSQLValueString($_POST['address1'], "text"),
                       GetSQLValueString($_POST['address2'], "text"),
                       GetSQLValueString($_POST['address3'], "text"),
                       GetSQLValueString($_POST['postcode'], "text"),
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString($_POST['website'], "text"),
                       GetSQLValueString($_POST['facebook'], "text"),
                       GetSQLValueString($_POST['twitter'], "text"),
                       GetSQLValueString($_POST['linkedin'], "text"),
                       GetSQLValueString($_POST['opening_monday_from'], "text"),
                       GetSQLValueString($_POST['opening_monday_to'], "text"),
                       GetSQLValueString($_POST['opening_tuesday_from'], "text"),
                       GetSQLValueString($_POST['opening_tuesday_to'], "text"),
                       GetSQLValueString($_POST['opening_wednesday_from'], "text"),
                       GetSQLValueString($_POST['opening_wednesday_to'], "text"),
                       GetSQLValueString($_POST['opening_thursday_from'], "text"),
                       GetSQLValueString($_POST['opening_thursday_to'], "text"),
                       GetSQLValueString($_POST['opening_friday_from'], "text"),
                       GetSQLValueString($_POST['opening_friday_to'], "text"),
                       GetSQLValueString($_POST['opening_saturday_from'], "text"),
                       GetSQLValueString($_POST['opening_saturday_to'], "text"),
                       GetSQLValueString($_POST['opening_sunday_from'], "text"),
                       GetSQLValueString($_POST['opening_sunday_to'], "text"),
                       GetSQLValueString($_POST['business_type'], "text"),
                       GetSQLValueString($_POST['business_description'], "text"),
                       GetSQLValueString($_POST['managers_message'], "text"),
             GetSQLValueString($insert_upload1, "text"),
             GetSQLValueString($insert_upload2, "text"),
             GetSQLValueString($insert_upload3, "text"),
             GetSQLValueString($insert_upload4, "text"),
             GetSQLValueString($insert_upload5, "text"));

  mysql_select_db($success, $insertSQL);
  $Result1 = mysql_query($insertSQL, $link) or die(mysql_error());  }






if (mysqli_query($link, $sql)) {
    echo "New record created successfully $username_entry";
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($link);
}

mysqli_close($link);

//! MySQLi insertInto
?> 


?>
  • 写回答

2条回答 默认 最新

  • dongye1912 2015-03-23 16:03
    关注

    Not as clean as i want, but i suggest you to try this rewrite of your code :

    <?php 
    
    // Comment in production
    ini_set('display_errors', 1); 
    error_reporting(E_ALL);
    
    // DataBase credentials & connection
    $user = 'root';
    $password = 'root';
    $db = 'welcometowarwick';
    $host = 'localhost';
    $port = 8889;
    
    
    $link = mysqli_connect(
        $host,
        $user,
        $password,
        $db,
        $port
    );
    
    
    if (!$link) {
        die('DB connection error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
    }
    
    mysqli_select_db($link, $db);
    
    
    
    ## Functions
    
    
    if (!function_exists("GetSQLValueString")) {
        function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
        {
            global $link;
    
            if (PHP_VERSION < 6) {
                $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
            }
    
            $theValue = mysqli_real_escape_string($link, $theValue);
    
            switch ($theType) {
                case "text":
                    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                    break;
                case "long":
                case "int":
                    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
                    break;
                case "double":
                    $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
                    break;
                case "date":
                    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                    break;
                case "defined":
                    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
                    break;
            }
            return $theValue;
        }
    }
    
    
    
    $username_entry = $_POST['username_entry'];
    
    if (empty($_POST['username_entry'])) {
        die('Username must be given');
    }
    
    $user_image_dir = "user_images";
    
    
    mkdir($user_image_dir."/".$username_entry, 0777, true);
    
    
    if (isset($_FILES['upload']) === true) {
        $files = $_FILES['upload']; 
    
        for($x = 0; $x < count($files['name']); $x++) { 
            $name = $files['name'][$x]; 
            $tmp_name = $files['tmp_name'][$x]; 
    
            move_uploaded_file($tmp_name, "$user_image_dir/{$username_entry}/{$name}"); 
    
            //echo '<pre>', print_r($files['name'][0], true), '</pre>'; 
    
            $image_upload1 = ($files['name'][0]); 
            $image_upload2 = ($files['name'][1]); 
            $image_upload3 = ($files['name'][2]); 
            $image_upload4 = ($files['name'][3]); 
            $image_upload5 = ($files['name'][4]); 
    
        }
    
    
        $insert_upload1 = "$user_image_dir/$username_entry/$image_upload1"; 
        $insert_upload2 = "$user_image_dir/$username_entry/$image_upload2"; 
        $insert_upload3 = "$user_image_dir/$username_entry/$image_upload3"; 
        $insert_upload4 = "$user_image_dir/$username_entry/$image_upload4"; 
        $insert_upload5 = "$user_image_dir/$username_entry/$image_upload5"; 
    
    
    
        $editFormAction = $_SERVER['PHP_SELF']; 
    
        $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); 
    
    
        $insertSQL = sprintf("INSERT INTO images (timestamp, username, password, business_name, address1, address2, address3, postcode, email, website, Facebook, twitter, linkedin, opening_monday_from, opening_monday_to, opening_tuesday_from, opening_tuesday_to, opening_wednesday_from, opening_wednesday_to, opening_thursday_from, opening_friday_from, opening_friday_to, opening_saturday_from, opening_saturday_from, opening_saturday_to, opening_sunday_from, opening_sunday_to, business_type, business_description, managers_message, image_1, image_2, image_3, image_4, image_5) VALUES (NOW(), %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", 
        GetSQLValueString($_POST['username_entry'], "text"), 
        GetSQLValueString($_POST['password_entry'], "text"), 
        GetSQLValueString($_POST['business_name'], "text"), 
        GetSQLValueString($_POST['address1'], "text"), 
        GetSQLValueString($_POST['address2'], "text"), 
        GetSQLValueString($_POST['address3'], "text"), 
        GetSQLValueString($_POST['postcode'], "text"), 
        GetSQLValueString($_POST['email'], "text"), 
        GetSQLValueString($_POST['website'], "text"), 
        GetSQLValueString($_POST['facebook'], "text"), 
        GetSQLValueString($_POST['twitter'], "text"), 
        GetSQLValueString($_POST['linkedin'], "text"), 
        GetSQLValueString($_POST['opening_monday_from'], "text"), 
        GetSQLValueString($_POST['opening_monday_to'], "text"), 
        GetSQLValueString($_POST['opening_tuesday_from'], "text"), 
        GetSQLValueString($_POST['opening_tuesday_to'], "text"), 
        GetSQLValueString($_POST['opening_wednesday_from'], "text"), 
        GetSQLValueString($_POST['opening_wednesday_to'], "text"), 
        GetSQLValueString($_POST['opening_thursday_from'], "text"), 
        GetSQLValueString($_POST['opening_thursday_to'], "text"), 
        GetSQLValueString($_POST['opening_friday_from'], "text"), 
        GetSQLValueString($_POST['opening_friday_to'], "text"), 
        GetSQLValueString($_POST['opening_saturday_from'], "text"), 
        GetSQLValueString($_POST['opening_saturday_to'], "text"), 
        GetSQLValueString($_POST['opening_sunday_from'], "text"), 
        GetSQLValueString($_POST['opening_sunday_to'], "text"), 
        GetSQLValueString($_POST['business_type'], "text"), 
        GetSQLValueString($_POST['business_description'], "text"), 
        GetSQLValueString($_POST['managers_message'], "text"), 
        GetSQLValueString($insert_upload1, "text"), 
        GetSQLValueString($insert_upload2, "text"), 
        GetSQLValueString($insert_upload3, "text"), 
        GetSQLValueString($insert_upload4, "text"), 
        GetSQLValueString($insert_upload5, "text")); 
    
    
    
    
        if (mysqli_query($link, $insertSQL)) {
            echo "New record created successfully $username_entry";
        } else {
            echo "Error: " . $insertSQL . "<br>" . mysqli_error($link);
        }
    
        mysqli_close($link);
    
    
    } else {
    
        die('no images given, so no insertion in DB');
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 汇编语言除法溢出问题
  • ¥65 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗