I have a PHP script designed to answer a users question. Currently I use arrays to provide the programmed questions and then echo the answer for that question. Instead, I want the script to search a MySQL database for questions and their answer. How can I do this in PHP?
我希望你能够理解我的问题。
这里是我的PHP代码:
<?php
if(stripos($_GET[ q ], what is my ip )===0){
echo "Your IP address is <b>{$_SERVER[ REMOTE_ADDR ]}</b>";
}
?>
<form method= get action= >
<input type= text name= q >
<input type= submit >
</form>