passing array checkbox value and update the database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shobu
    New Member
    • Mar 2007
    • 3

    passing array checkbox value and update the database

    passing array checkbox value and update the database <?include 'dbconnect.php' ; error_reporting (0);$update_qr= "update vv_menu set publish='inacti ve' ";
    $re_qr=mysql_qu ery($update_qr) or die (mysql_error()) ;
    foreach($_POST['publish'] as $check=>$value)
    {
    $m_id=mysql_rea l_escape_string ($value);
    $update_qr="upd ate vv_menu set publish='active ' where itemid='$m_id' ";
    echo $update_qr;
    $re_qr=mysql_qu ery($update_qr) or die (mysql_error()) ;
    ?> The above code is correct or not. But i got null report
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Welcome to TSDN!

    Before you post anything, read the Posting Guidelines at the top of this forum, especially the part about enclosing any shown code within code or php tags!!

    Unformatted code is unreadable and diminishes your chance that anyone will look at it, puzzling.

    The code as you show it cannot run anyway. E.g. where is your closing brace?

    moderator

    Comment

    • shobu
      New Member
      • Mar 2007
      • 3

      #3
      Thank u for giving inofrmation

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Does that mean that your problem is solved or not?

        Ronald :cool:

        Comment

        Working...