一個(gè)奇怪的有關(guān)問題,查入數(shù)據(jù)庫的時(shí)候,少一值
Jun 13, 2016 am 10:18 AM
一個(gè)奇怪的問題,查入數(shù)據(jù)庫的時(shí)候,少一值
是這樣的, 在電視里面有分集信息,我要把新的分劇內(nèi)容介經(jīng)紹數(shù)據(jù)$info 查入到數(shù)據(jù)庫里,
在插入的時(shí)候,我是這樣進(jìn)行判讀的。
$info 對應(yīng)的鍵值等于電視的集數(shù)。如果相等,則 把對應(yīng)的內(nèi)容插入到分集字段(s_description)里
問題就出現(xiàn)了:
每一次插入的時(shí)候,第一集電視劇插入不進(jìn)去。
其它集數(shù)的內(nèi)容與集數(shù)是相符的
我的代碼是這樣的。
- PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> while(list($key ,$value)=each($rs)){ //$rs為數(shù)據(jù)庫里的電視劇分集數(shù)組 echo $value['s_num']; foreach ( $info as $keys => $v){ //$info為分集內(nèi)容數(shù)組。 echo $keys."<br>"; if($value['s_num'] == $keys){ //$value['s_num']為集數(shù) $option['table'] = $this->module->getTableName('ms_series_info'); $option['data']['s_description'] = $v; $option['where'][] = 's_num ='.$keys; $option['where'][] = 's_id = '.$id; $s = $this->module->update($option); if($s){ break; } } $option=''; } }
注:本來$info的初使鍵值是0的。 我處理了一下。$info 對應(yīng)的初使鍵字是1(處理方法就是用集數(shù)$num與集數(shù)內(nèi)容 $content 對應(yīng)上。),做為第一集,
還請問一下,大伙有沒有出現(xiàn)這一種現(xiàn)象
------解決方案--------------------
敢不敢用數(shù)據(jù)說話。。。 描述太抽象了。
------解決方案--------------------
不知道你用的什么框架,把每一條sql打印出來 檢查下

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

PHP ?? ??? ?? ???? ?? ? ????? ??? ?????. 1. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2
