comp.databases.mysql
  Home FAQ Contact Sign in
comp.databases.mysql only
 
Advanced search
August 2008
motuwethfrsasuw
    123 31
45678910 32
11121314151617 33
18192021222324 34
25262728293031 35
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.databases.mysql Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  "Column count doesn't match value count at row 1"         


Author: spammyinboxhere
Date: Aug 20, 2008 00:25

So, anyone know why this fails? I'm making a exact copy of the
structure of a table and then putting a known good entry into it and
then trying to copy it back. At worst, it should give a duplicate key
error. But instead it gives a "Column count" error.
mysql> create table `LogEntries_copy` like `LogEntries` ;
Query OK, 0 rows affected (0.17 sec)
mysql> insert into `LogEntries_copy` select * from `LogEntries` limit
1;
Query OK, 1 rows affected (0.17 sec)
mysql> insert into `LogEntries` select * from `LogEntries_copy`;
Column count doesn't match value count at row 1
mysql>

Thanks much to anyone that can advise.
mysql> describe `LogEntries`
-> ;
+---------------------+---------------------+------+-----
+---------------------+----------------+
| Field | Type | Null | Key |
Default...
Show full article (8.59Kb)
no comments
  Need help with query         


Author: thelma
Date: Aug 19, 2008 19:42

This is what I want:

SELECT acol1 from aTable
WHERE (acol0='x' and acol1='jack')
OR (acol0='x' and acol1='jill')
OR (acol0='x') limit 1;

That is, I want 'jack' if he meets the second criterion, 'jill'
if he fails but she doesn't, and if they're both out I'll take
anyone who does meet it.

The above select doesn't care about my priorities and just picks the
first acol0 that satisfies any of the OR's.

What do I want to write?

thanks, --thelma
2 Comments
  UPDATE fails.         


Author: Ronald Schow
Date: Aug 19, 2008 19:27

I'm using mysql v 5.0.51. The database is on my host server at ipower.com.
I cannot get UPDATE write to the database.
I know it's something is my code - I'm a total novice to databases in
general. I've opened the database within the same .php file, I display data
just fine. Can't update from the code, though. Using the same user, I AM
able to update using the host's online phpmyadmin. So, can you help me with
my code? Here it is:
I open the db and table with this,

$host = "host_name";
$db = "dbEvents";
$user = "dbAdmin";
$password = "secret";
"mysql_connect ($host, $user, $password) or die ("Cant open the db because:
" . mysql_error() );
mysql_select_db ($db);
$query = mysql_db_query($db, "SELECT * FROM announcementsTable order by
idx"); $record = mysql_fetch_array($query);"

I can read all the records and their fields.

I build a table of each record where I edit the record in a (very
abbreviated) form: "title" is a field name, it's data is assigned to
"TitleName".
"while ($results = mysql_fetch_array($query)) {
...
Show full article (2.29Kb)
5 Comments
  INSERT ... ON DUPLICATE KEY UPDATE vs REPLACE ?         


Author: William Gill
Date: Aug 19, 2008 08:12

I am having to recreate some apps after the ones I created several years
ago were destroyed. One (common) problem was creating a new record in a
related table if one doesn't already exist to update. I don't remember
how I was doing it before, but in researching I came across INSERT ...
ON DUPLICATE KEY UPDATE and REPLACE. They both seem to be able to do
what I need. Am I wrong? Can anyone tell me the difference?
3 Comments
  CREATE DATABASE         


Author: Mike P
Date: Aug 19, 2008 03:31

Hi Experts,

New to MySQL,

I have a txt file that has all the information to build a new database
in MySQL code that works, but i only want to create the database if it
doesn't exist, (part of a bigger problem)

i can see i need to use CREATE DATABASE and the IF NOT EXIST commands,
but i can't see any literature on importing the text file for the
schema i want.

Can anyone help with this?

Cheers

Mike
2 Comments
  best mysql frontends         


Author: h.stroph
Date: Aug 18, 2008 20:21

Within CentOS-5.2 Linux we have installed mysql-5.0.45.7.elf and
mysql-server-5.0.45.7.elf.

What gui frontends are available to build and populate databases and to
design the gui query forms to get information back out as desired, please?
no comments
  Date format         


Author: Donald Campbell
Date: Aug 18, 2008 13:11

I am looking at moving some old database systems to MySQL and I am
currently working on data loading using mysqlinport.

I have an issue with dates as all the data that is coming my way has
dates in DD/MM/YYYY. the load routines look to only accept it in
YYYY/MM/DD.

Is there anyway of telling the routines to use the European date format?

Would be nice if it could display dates in the format as well.

I did find a variable called "data_format" in the online documentation,
however, it said that it was no-longer used.

THanks.

Don
11 Comments
  Please Help with query construction         


Author: mpar612
Date: Aug 17, 2008 15:41

I am building an app for a restaurant. The restaurant has multiple
menus. When the user comes to a page for a specific menu I need to
pull all item data from multiple database tables. There are multiple
categories of items, each item falls under a category. Some categories
have items that fall into sub categories.

I posted my database tables and a basic sample of the output below. I
know how to do this and it is easy if I create one huge table, but due
to the amount of data I am working with I need to make sure that this
is put together as efficiently as possible.

Is it possible to combine all of this into one SQL statement? Can
anyone offer a better way to make this work? Any thoughts would be
greatly appreciated. Thanks in advance.

I have three tables:
Show full article (1.47Kb)
1 Comment
  Problems with REVOKE.         


Author: John Nagle
Date: Aug 17, 2008 13:48

I have a user account with privilege:

GRANT USAGE ON `edgar`.`edgar` TO 'downside'@'localhost' WITH GRANT OPTION

How do I revoke this specific privilege?

I've tried, as database root,

REVOKE ALL PRIVILEGES on edgar.edgar FROM downside@localhost;

and the command is accepted, but SHOW GRANTS still shows the grant above.

I tried

REVOKE USAGE on edgar.edgar FROM downside@localhost;

which is also accepted, but has no visible effect.

I finally had to do

REVOKE ALL PRIVILEGES, GRANT OPTION FROM downside@localhost;

which also revoked other stuff I didn't want to revoke.

GRANT and REVOKE are supposed to be symmetrical, but they don't quite seem to be.

John Nagle
4 Comments
  Query MySQL from Excel         


Author: Donald Campbell
Date: Aug 16, 2008 09:45

Is it possible to pick up information from a MySQL database using a
macro in Excel?

Don
2 Comments
1 2 3 4 5 6 7 8 9