Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8254091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:05:18+00:00 2026-06-08T01:05:18+00:00

Hi Guys my code is below. What I’m trying to do is to update

  • 0

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)


    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:05:19+00:00Added an answer on June 8, 2026 at 1:05 am
    <?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
    
            //no need of part 2 to update records in table
            //part 3 loop removed
            mysql_query("UPDATE `$DBNAME`.`video` SET `Secret_key` = '0' ",$connect);
    
    
    ?>
    

    Try this. May it will solve ur problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

so guys, if u test the code below, u can see that everything is
guys, I would like to you evaluate next code below. As you see, I
Hello guys look to my code I'm trying to make a program which asks
Hi guys I'm trying the code samples from zend frameworks site on how to
pls help me. how can I split this String value? my code below wont
hey guys, i have very small issue please see the code below // this
I am trying to understand this one line of code below: str_replace('../', '', $route);
I'm trying to write code that can print only filled text boxes in the
My concern in the code below is that the param to constructor is not
In my application I'm able to get all MMS through code below, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.