如何使用php导入mysql数据库中的.sql文件
我怎么能这样做,请帮我解决这个问题谢谢
此代码显示此错误..
There was an error during import. Please make sure the import file is saved in the same folder as this script and check your values:
MySQL Database Name: test
MySQL User Name: root
MySQL Password: NOTSHOWN
MySQL Host Name: localhost
MySQL Import Filename: dbbackupmember.sql
Run Code Online (Sandbox Code Playgroud)
我正在使用此代码
<?php
//ENTER THE RELEVANT INFO BELOW
$mysqlDatabaseName ='test';
$mysqlUserName ='root';
$mysqlPassword ='';
$mysqlHostName ='localhost';
$mysqlImportFilename ='dbbackupmember.sql';
//DONT EDIT BELOW THIS LINE
//Export the database and output the status to the page
$command='mysql …Run Code Online (Sandbox Code Playgroud) 我想在单击编辑按钮时更新我的表单,然后所有信息都正确显示,但状态值始终显示相同的打开选项。我不知道为什么它显示相同的打开状态,而我当前的状态已完成,但它始终显示打开,请帮助我解决此问题,谢谢
这是我的表单代码用户名显示正确但状态显示不正确
<p><label class="field" for="username">UserName:</label>
<input name="username" type="text" id="username" value="<?php echo $username; ?>" size="50" />
</p>
<p>
<label class="field" for="Status">Status</label>
<select name="status" id="status" value="<?php echo $status; ?>" >
<option value="open">Open</option>
<option value="done">Done</option>
<option value="pending">Pending</option>
<option value="working">Working</option>
</select>
</p>
Run Code Online (Sandbox Code Playgroud) 这显示了这样的结果 70.479
我想要这样的结果 70.500
我该怎么做,请帮我解决这个问题,谢谢
<?php //Starting of php
if(isset($_POST['submit']))//if the submit button has pressed
{
$first = $_POST['first']; //Getting Value of first integer from add.html
$sec = $_POST['sec']; //Getting Value of Second integer from add.html
$res = $first * $sec *75 /365 /30; //Adding the two values and placing the added result to 'res' variable
echo 'Added Result:';
echo "<br>Rounded value of the number = ".round($res,3);
}
//Ending of php
?>
Run Code Online (Sandbox Code Playgroud)