私はチュートリアルや例を使用し、問題に関する他の多くの質問を調べましたが、それでも機能させることができません。私はPHPに比較的慣れておらず、PDOについてまったく理解していません。大学から提供された減価償却されたコードを取り除くために、コードをmysqlではなくmysqliに変更しましたが、この状況ではあまり役に立ちませんでした。
誰かが私のためにこの問題に光を当てることができれば、私は非常に感謝するでしょう。以下は私のコードサンプルです:
<?php /*connect to the db */
$link=mysqli_connect("dbhost","user","pass");
mysqli_select_db("db",$link);
/*checking connection*/
if ($link->connect_errno)
throw new exception(sprintf("Could not connect: %s", $link->connect_error));
session_start();
$insert_query="
INSERT INTO testone_tbl (age,hours,flexibility,fastpaced,retailexp,
workedus,conviction,permit,education)
VALUES ('$age','$hours','$flexibility','$fastpaced','$retailexp','$workedus',
'$conviction','$permit','$education');
INSERT INTO testtwo_tbl
(contribute,insales,initiative,success,alternatives,targets,
newthings,custfeed,incdevelop,standards,confident,stretch,
opportunities,polite,ideas,deadline,supported,duties)
VALUES ('$contribute','$insales','$initiative',
'$success','$alternatives','$targets','$newthings',
'$custfeed','$incdevelop','$standards','$confident','$stretch',
'$opportunities','$polite','$ideas','$deadline','$supported','$duties')";
/*execute multi_query*/
mysqli_multi_query ($link, $insert_query);/*error1*/
/*close connection*/
if(!$link>connect_errno) $link->close(); /*error2*/
?>
データは、これが書き込まれたフォーム(最後のフォーム)と前のフォームのセッションの両方からのものです。ただし、次のエラーも発生します。警告:mysqli_multi_query()はパラメーター1がmysqliであると想定しWarning: mysqli_close() expects parameter 1 to be mysqli
ており、過去数日間これに固執しています。前もって感謝します。