Results 1 to 10 of 10

Thread: [RESOLVED] updating records in db error

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    Resolved [RESOLVED] updating records in db error

    Hi, i am new in php

    Whats wrong with my codes?
    My server is using PHP Version 5.2.11

    Code:
    <?php
    $con = mysql_connect("localhost","username","password");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("my_database", $con);
    mysql_query("UPDATE my_table SET 
    machinetime = '$_POST[strDate]',
    server = '$_POST[strServer]',
    name = '$_POST[struser]',
    imei = '$_POST[strImei]',
    model = '$_POST[strModel]',
    price = '$_POST[strPrice]',
    refnum = '$_POST[strRef]'
    WHERE PID = '$_POST[processID]'");
    if (!mysql_query($sql,$con))
      {
      die('Error: ' . mysql_error());
      }
    echo "Record Updated";
    mysql_close($con)
    ?>

    When i click submit in my Form

    It always throw me an error "Error: Query was empty"
    Last edited by dr_aybyd; Dec 15th, 2009 at 10:59 AM.
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width