Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 17th, 2003, 07:23 AM
Authorized User
Join Date: Sep 2003
Location: London, , United Kingdom.
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


Reply With Quote
  #2 (permalink)  
Old October 17th, 2003, 03:13 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts

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,

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 01:29 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.