我是使用mysql占位符的新手。我正在尝试,但进展并不顺利。据我所知,将绑定参数直接复制到书本之外时,我的绑定参数出现错误。
我犯了什么荒谬的明显错误?
echo <<<_END
<table>
<tr><td>Title </td><td> <input type = "text" name = "title" size =70></td></tr>
<tr><td>Subtitle </td><td> <input type = "text" name = "subtitle" size ="65"></td></tr>
<tr><td>Description </td><td> <input type = "text" name = "description" size = "100"></td></tr>
<tr><td>location </td><td> <input type = "text" name = "location" size = "5"></td></tr>
<tr><td>pages </td><td> <input type = "number" name = "pages">. </td></tr>
<tr><td>Present </td><td> <input type= "number" name = "present" min="2" max ="8"> </td></tr>
</table>
<br>binding <br>Paperback<input type = "radio" name = "binding" value = "2" checked>
Cloth<input type="radio" name="binding" value = "1"><br>
Index <input type = "checkbox" name = "w_index">
Maps <input type = "checkbox" name= "w_maps">
Illustration <input type = "checkbox" name = "w_illustration">
Bibliography <input type = "checkbox" name= "w_bibliograpghy">
<br><br><br>
<input type ='submit' value = 'new book'>
_END. ;
if ( !( $ST= $zx1->prepare("insert into books values (?,?,?,?,?,?,?,?,?,?) ")))
{echo'stage1';}
$ST->bind_param('ssssiiiiii',$title,$subtitle,$description,$location,$page. s,$present,$binding,$maps,$illustration,$index))
{echo 'stage 2'};
echo 'Binding parameters failed: ('.$stmt->errno.')'.$stmt->error ;};
if (! $ST->execute())
{echo 'stage 3' ;};
?>
谢谢您的协助。我完全在海上