我一直在看这段代码一段时间,我看不出问题出在哪里.我一直在阅读整个StackOverflow,但仍无法看到我的错误.
<?php
mysqli_connect("localhost","root","","web_table");
mysql_select_db("web_table") or die(mysql_error());
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
echo "<p> Connection Successful!"
mysqli_query('INSERT INTO web_formitem (ID, formID, caption, key, sortorder, type, enabled, mandatory, data) VALUES (105, 7, Tip izdelka (6), producttype_6, 42, 5, 1, 0, 0)');
echo "<p>Insert successfull";
?>
Run Code Online (Sandbox Code Playgroud)
错误在第13行的某处,那就是mysqli_query('insert....我试图用http://www.w3schools.com/php/php_mysql_insert.asp来帮助自己,但这对我帮助不大.
我一直在寻找类似的问题,但没有发现任何人有类似的问题或可能的解决方案.我有preg_match_all函数,它找到了5个匹配项并将它们返回到数组中.如何计算数组中的字符串?
preg_match_all("/\)\">(.*?)<\/a>/s",$value,$counter);
here is var_dump(counter[1]):
array (size=1)
0 => string 'word1' (length=..)
array (size=1)
0 => string 'word2' (length=..)
array (size=1)
0 => string 'word3' (length=..)
array (size=1)
0 => string 'word4' (length=..)
array (size=1)
0 => string 'word5' (length=..)
Run Code Online (Sandbox Code Playgroud)
正如你所看到的那样,它返回了我的5场比赛,但是我不能打印那个数字array_count_values,count()...我已经尝试了爆炸,然后得到字符串,但也count()不会工作.
count($counter[1]) returns me ->
int 1
int 1
int 1
int 1
int 1
Run Code Online (Sandbox Code Playgroud)
我需要获得一些比赛,我没有更多的想法,所以任何事情都是非常受欢迎的.
更新:这是var_dump($ value);
string '<h2><a href="javascript:Organigram.toggle('organigram_section_29')">word1</a></h2><div class="show"><p class="nums"><span class="phone">03 839 11 00</span></p>' (length=170)
string '<h2><a href="javascript:Organigram.toggle('organigram_section_35')">word2</a></h2><div class="show"><p class="nums"><span class="phone">03 …