Hi Guys my code is below.
What I’m trying to do is to update all of the value in mysql that satisfy a specific a specific condition. Now when I just type in the mysql query:
UPDATE `$DBNAME`.`video` SET `Secret_key` = '0'
The query works fine but I can’t seem to write php code that will do this.
Any help is welcomed
<?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)
?>
Try this. May it will solve ur problem.