Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 17th, 2003, 07:23 AM
Authorized User
 
Join Date: Sep 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jams30
Default Manipulating data in a database - page 396 problem

Ok, this is the deal

I have installed WinMySQLadmin 1.4 client on a Windows 2000 os, all seems to be ok to the point where I have managed to create a new test database successfully. However, when trying to create a new user in the 'user' table in the database 'mysql' using the following code I get the error as below:

mysql> insert into user values(
    -> 'localhost',
    -> 'phpuser',
    -> password('phppass'),
    -> 'n', 'n', 'n', 'n', 'n', 'n', 'n',
    -> 'n', 'n', 'n', 'n', 'n', 'n', 'n');
ERROR 1136: Column count doesn't match value count at row 1

I have tried this over and over again, checking my syntax etc. but still have the same problem, the only things that are different in my set up are:

1) The file my-example.cnf was not part of the set up - the only .cnf files that I have are - my-small.cnf, my-medium.cnf, my-large.cnf and my-huge.cnf, therefore I have not copied, renamed and paste into/as C:\my.cnf - I'm not sure if this is causing or going to cause any problems.

2) When using the DESC command to list the 'user' table structure I get a return of 31 rows in set (14 additional rows as below) -
| Show_db_priv
| Super_priv
| Create_tmp_table_priv
| Lock_tables_priv
| Execute_priv
| Repl_slave_priv
| Repl_client_priv
| ssl_type
| ssl_cipher
| x509_issuer
| x509_subject
| max_questions
| max_updates
| max_connections

Can someone please advise on where I may be going wrong on this, as I have since discovered that these initial steps are required in order for me to be able to continue with the 'try it outs' etc....

Many thanks

Jamal

 
Old October 17th, 2003, 03:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, the error message suggests you're inserting the wrong number of columns.

If your user table has additional columns not created by the default installation of MySQL*, then you'll have to modify your query to either list the columns you're inserting into OR insert values for ALL columns in the user table.

1: INSERT INTO user (Host, User, Password) VALUES ('localhost', 'user', password('pass'));

2: INSERT INTO user ('localhost', 'user', ... all 31 columns here);


* The mysql.user table should have 17 columns, host, user, pass, the following yes/no permissions flags:
  Select_priv Insert_priv Update_priv Delete_priv
  Create_priv Drop_priv Reload_priv Shutdown_priv
  Process_priv File_priv Grant_priv References_priv
  Index_priv Alter_priv


Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Manipulating Data with Expressions baaul Reporting Services 2 June 22nd, 2006 10:14 AM
Manipulating Data Problem - - - - Please Help! sendoh11 ASP.NET 1.0 and 1.1 Professional 1 June 29th, 2005 02:40 AM
Manipulating the data in db dungey PHP Databases 4 January 6th, 2005 11:31 AM
manipulating data in DAO jimmy Access VBA 2 November 19th, 2003 10:55 AM
Manipulating data in ASP sri2004 Classic ASP Databases 0 June 17th, 2003 07:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.