My ISP is running mysql 3.23...

Their server hates me...

This mysql_query...

UPDATE tbl_dealers SET passwd = password( 'test456' ) WHERE username = 'testuser'

MySQL said: Unknown column 'passwd' in 'field list'

Anyone familiar with IPOWERWEB Host's mysql setup? Because the column exists...

    im not a hundred percent sure, but i think ur not supposed to quote the column names, that may be ure problem, and also password( 'test456' ) is a variable, should have $ sign in front.

    eg, right code:

    UPDATE tbl_dealers SET passwd = $password( 'test456' ) WHERE username = 'testuser' 
    

    dunno if this works, cant try it on my server, different MySQL version.

      Quoting the column names with backticks is generally okay.

      Are you sure the name (and case) is correct?

      Run a DESCRIBE query or something to confirm.

        Thanks for your help...

        What I've discovered from Googling around is that Mysql 3.23 doesn't support UPDATE...SET...WHERE...too well. BTW backticks make this server happy. What I'm thinking is I need to develop a script that substitutes for UPDATE...SET...WHERE...

        This works:

        $result = mysql_query("SELECT passwd FROM tbl_dealers WHERE 1 AND username = 'testuser'")
        or die('mysql_query: failed');
        $num_results = mysql_num_rows($result);
        echo $num_results;

        So I probably can't just reassign:

        mysql_num_rows($result)=password('test456');

        can I?

          That's strange, I think that version of mysql is quite common, and I've never had such problems with it.

          I'm not sure what are the alternatives to that, you'll might have to try the mysql manual at mysql.com

          Trying to re-assign with
          mysql_num_rows($result)=password('test456');
          simply wont work.

            Thanks for your help...

            OK... I was mistaken. UPDATE...SET...WHERE...works. It is just a finicky server. It needs a space between the backtick and the field_name.

            Like:

            UPDATE tbl_dealers SET passwd = password('test456') WHERE username = 'testuser'

            instead of:

            UPDATE tbl_dealers SET passwd = password('test456') WHERE username = 'testuser'

            and notice also that username doesn't need backticks in this instance.

              Write a Reply...