第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

mysql/androidstudio,表上的列僅接受 int,而不接受 varchar

mysql/androidstudio,表上的列僅接受 int,而不接受 varchar

PHP
搖曳的薔薇 2023-12-15 14:59:48
我正在嘗試在表中插入行,但是列“department”只接受整數(shù)。 我使用此教程作為我的指南。如果我將第四列(部門)的類型更改為 int 并在其上插入 int ,則一切正常。但我需要繩子。我已經(jīng)將所述列的類型更改為 VARCHAR 但始終顯示“0”在桌子上,即使我插入一個(gè)字符串。我的桌子這是我的表結(jié)構(gòu)API.php<?php require_once '../includes/DbOperation.php';function isTheseParametersAvailable($params){    $available = true;     $missingparams = "";         foreach($params as $param){        if(!isset($_POST[$param]) || strlen($_POST[$param])<=0){            $available = false;             $missingparams = $missingparams . ", " . $param;         }    }    if(!$available){        $response = array();         $response['error'] = true;         $response['message'] = 'Parameters ' . substr($missingparams, 1, strlen($missingparams)) . ' missing';        echo json_encode($response);                die();    }}$response = array();if(isset($_GET['apicall'])){        switch($_GET['apicall']){                //the CREATE operation        //if the api call value is 'createhero'        //we will create a record in the database        case 'createemployee':            //first check the parameters required for this request are available or not             isTheseParametersAvailable(array('firstname','lastname','department','image'));                        //creating a new dboperation object            $db = new DbOperation();                        //creating a new record in the database            $result = $db->createEmployee(                $_POST['firstname'],                $_POST['lastname'],                $_POST['department'],                $_POST['image']                            );                        }                    break; 
查看完整描述

1 回答

?
一只名叫tom的貓

TA貢獻(xiàn)1906條經(jīng)驗(yàn) 獲得超3個(gè)贊

$stmt->bind_param("ssis", $firstname, $lastname, $department, $image);

使用 中的 i,您指定此處的第三個(gè)插入值應(yīng)該是整數(shù),因此它會(huì)被視為整數(shù),其中包括轉(zhuǎn)換無效值為零。ssis


查看完整回答
反對(duì) 回復(fù) 2023-12-15
  • 1 回答
  • 0 關(guān)注
  • 138 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)