嗨,伙计们,我的代码如下。
我要做的是更新 mysql 中满足特定特定条件的所有值。现在,当我输入 mysql 查询时:
UPDATE `$DBNAME`.`video` SET `Secret_key` = '0'
查询工作正常,但我似乎无法编写能够执行此操作的 php 代码。欢迎任何帮助
<?php
// Part 1 (works fine)
include("/home3/kintest2/public_html/include/config.local.php");
$connect= mysql_connect ($DBHOST,$DBUSER,$DBPASSWORD);
$select= mysql_select_db($DBNAME, $connect);
// End of Part 1
// Part 2 (works fine)
$test2= "SELECT * FROM `video`";
$results= mysql_query($test2, $connect);
$num_rows = mysql_num_rows($results);
// End of part 2
// Part 3 ( Not too sure about this part)
for ($num_rows= $count; $count >= 0; $count--)
{
mysql_query("UPDATE `$DBNAME`.`video` SET `Secret_key` = '0'",$connect);
}
// End of part 3 ( Not too sure about this part)
?>