niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » MySQL
err-report help me
Post new topic   Reply to topic Page 3 of 67 [996 Posts] View previous topic :: View next topic
Goto page:  Previous  1, 2, 3, 4, 5, ..., 65, 66, 67 Next
Author Message
Martin Norland
*nix forums beginner


Joined: 07 Feb 2005
Posts: 2

PostPosted: Mon Feb 07, 2005 2:16 pm    Post subject: Re: [PHP-DB] mysqli connection problem Reply with quote

Denis Gerasimov wrote:
Quote:
Hello,

This question was asked many times, but I can't find a good answer.
I am getting this error message while trying to connect to MySQL server (PHP
+ PEAR::DB_DataObject):

"Can't connect to local MySQL server through socket '' (111)"

(notice '' - is that right?)

Does anyone have any ideas about how to get rid of this error?

Configuration:
* RedHat Enterprise Linux AS3
* Apache 2.0.46
* PHP 5.0.2
* MySQL 4.1.9, mysqli ext.

Thanks!

[Note: reply-to set to php-db as it's multimailed and I don't see this
as a mysql general issue, nor php general, but feh.]

Looks to be set blank/null/etc.

You may be slightly tricked by the existence of both of these - from
your standard php.ini...
-----
; Default socket name for local MySQL connects. If empty, uses the built-in
mysql.default_socket =

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysqli.default_socket =
-----
I can't see any reason why you wouldn't be able to use the same socket -
you're connecting to the same exact server, it's just a path. You
should be perfectly able to set your mysqli.default_socket to the same
as the mysql.default_socket. I can't tell you what the default for your
system is, but there are php functions to get configuration options, if
you don't have it in any obvious places.

Cheers,
--
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Artem Koltsov
*nix forums beginner


Joined: 07 Feb 2005
Posts: 2

PostPosted: Mon Feb 07, 2005 3:12 pm    Post subject: RE: How do I Put a 'Literal' Value in a Report Column? Reply with quote

see 12.2 Control Flow functions of MySQL manual

select name, if(adopted=0,'N','Y') from animal;


Quote:
-----Original Message-----
From: Sue Cram [mailto:shcram@worldnet.att.net]
Sent: Monday, February 07, 2005 2:58 AM
To: mysql@lists.mysql.com
Subject: How do I Put a 'Literal' Value in a Report Column?


This is a pretty basic question, but I'm learning SQL from a
book and it's very very frustrating!

I'm writing a report listing animals from our shelter and
whether they have been adopted. I am selecting the animal
name field and a field called 'adopted' from a table called
'animal'. The values in 'adopted' are either: 1 (meaning
yes, this animal was adopted) or 0 (no, this animal has not
been adopted).

So far I:
"SELECT Name, Adopted FROM animal". This prints a column of
animal names and a column labeled "Adopted" with row after
row of 0's and 1's. I want my output report to say 'Y' if
'adopted' = 1 or 'N' if adopted = 0.

I've spent all day studying "Insert Into", "Update Where",
"If... Then", looking at SQL manuals (so far I've studied 3
of them), and trying to find an example in existing code. I
get syntax errors for everything I try. This is a very
simple thing that's done all the time -- but I can't figure
out how in SQL.

Can someone help me?
Thanks,
Sue

 

Attention:
Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material from any system and destroy any copies.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
sirisha gnvg
*nix forums beginner


Joined: 04 Feb 2005
Posts: 3

PostPosted: Mon Feb 07, 2005 5:16 pm    Post subject: Re: max key file length Reply with quote

Ingo Strüwing <ingo@mysql.com> wrote:
Hi Sirisha,

Am Donnerstag, den 27.01.2005, 08:41 +0000 schrieb sirisha gnvg:
Quote:
hai,
I tried the command "myisamchk -d -v ".It gives the output containing data file length,key file length,max key file length of a myisam table.I supposed to use the value of "MAX KEY FILE LENGTH" in my java program.For that I search the souce code of mysql 4.1.8.It is used in the statement "llstr(share->base.max_key_file_length,llbuff2)" in
../myisam/myisamchk.c.(where share is a structure variable for MYISAM_SHARE& base is a structure variable for MI_BASE_INFO).But I could not get how it is computed.Can any one suggest me in detail
1.HOW THE "MAX KEY FILE LENGTH " IS COMPUTED?

myisam/mi_info.c mi_info():
max_key_file_length=
mi_safe_mul(MI_MIN_KEY_BLOCK_LENGTH,
((ulonglong) 1 << (share->base.key_reflength*Cool)-1);

Quote:
2.WHAT ARE THE VARIABLES USED IN COMPUTING THAT PARAMETER?

key_reflength is read from the key file by my_n_base_info_read() in
mi_open().

Quote:
3.HOW CAN I USE THOSE VARIABLES IN MY JAVA PROGRAM IN COMPUTING "MAX KEY FILE LENGTH"?

You can read the key file, following the file layout as given by the
above mentioned functions. In that case, max_key_file_length is itself
part of the key file. You just need to figure out, at which offset it
is.

Regards,
Ingo
--
Ingo Strüwing, Senior Software Developer
MySQL AB, www.mysql.com
Office: +49 30 43672407

Are you MySQL certified? www.mysql.com/certification





Respected sir,

Thank you for your reply.You suggested me that both key_reflength and max_key_file_length can be read from "key file".We just need to find the offset at which they are stored in "key file".But I have searched all files containing "key" as part of their name in "MySQL 4.1.9" folder for "max_key_file_length" and all those files all c or c++ program files.

Then what do you mean by finding offset?Please once again explain in detail what "key file" is and what it contains.

Thanking you,

sirisha.



Yahoo! India Matrimony: Find your life partneronline.
Back to top
Jan Kirchhoff
*nix forums beginner


Joined: 07 Feb 2005
Posts: 16

PostPosted: Mon Feb 07, 2005 9:49 pm    Post subject: Re: Replication suddenly stops on mysql 4.1.7 with Slave_IO_Running: No Reply with quote

We've had very good performance with the official mysql-icc-binaries, so
I upgraded to 4.1.8 last weekend since there is no official 4.1.9 binary
on the mysql.com-site...

It didn't help with my problems, I still have replication-crashs almost
every other hour. I put a fresh snapshot from the master onto the slave
but it didn't help either Sad
A simple "slave start" helps, so I have a cronjob running right now
checking for the replication-status and issuing a "slave start" if
necessary....

I have no other idea but try the gcc-4.1.9 in about 3 weeks, I have no
possibility to take the master database down anytime before that :(

Gleb Paharenko schrieb:

Quote:
Hello.





But I use 4.1.7, not 4.0.21 ...weird.





As said at:

http://dev.mysql.com/doc/mysql/en/news-4-1-8.html



"Fixed a bug which caused a crash when only the slave I/O thread was

stopped and started. (Bug #6148)"



I suggest you to upgrade to the latest release (4.1.9 now).











Jan Kirchhoff <kirchy@gmx.de> wrote:





Gleb Paharenko schrieb:








Hello.














I've looked through the bug database, and the only thing








that I've found was an already-closed bug:








http://bugs.mysql.com/bug.php?id=6148














I had been looking around the Changelogs, but I had not found that one.





Sounds pretty much like my problem :(





But I use 4.1.7, not 4.0.21 ...weird.








Check that your server passes rpl_relayspace.test. Go to the mysql-test








directory and execute:








./mysql-test-run t/rpl_relayspace.test














This one runs wirhout errors on the master and the slave...:








hostname:/usr/local/mysql-standard-4.1.7-pc-linux-i686-icc-glibc23/mysql-test#





./mysql-test-run t/rpl_relayspace.test





Installing Test Databases





Removing Stale Files





Installing Master Databases





running ../bin/mysqld --no-defaults --bootstrap --skip-grant-tables





--basedir=.. --datadir=mysql-test/var/master-data --skip-innodb





--skip-ndbcluster --skip-bdb





Installing Slave Databases





running ../bin/mysqld --no-defaults --bootstrap --skip-grant-tables





--basedir=.. --datadir=mysql-test/var/slave-data --skip-innodb





--skip-ndbcluster --skip-bdb





Manager disabled, skipping manager start.





Loading Standard Test Databases





Starting Tests








TEST RESULT





-------------------------------------------------------





rpl_relayspace [ pass ]





-------------------------------------------------------








Ending Tests





Shutting-down MySQL daemon








Master shutdown finished





Slave shutdown finished





All 1 tests were successful.








I'm not able to exchange the mysql-software itself (I use the





icc-binary) to a gcc-version or to upgrade to 4.1.9 in the next 2-3





weeks. And looking at the changelogs on mysql.com I don't think it would





change anything...





Hasn't anybody else had such problems with 4.1.x?








hostname:/usr/local/mysql-standard-4.1.7-pc-linux-i686-icc-glibc23/bin#





./mysqld --version





./mysqld Ver 4.1.7-standard for pc-linux on i686 (Official





MySQL-standard binary)








(more detailed information on my systems in my initial mail from 2005-1-27)








btw: I also ran mysqlcheck -q and mysqlcheck -o on all tables last week





to make sure the tables are OK...





























Jan Kirchhoff <kirchy@gmx.de> wrote:

















Hi,






































My problem still goes on... After having had the problem 2 more times


























within 1 day, I decided to re-do the replication (copy the whole


























database onto the slave with rsync and reset master and slave). That


























only lasted for little more than 1 day and I ended up with the same error:






































Could not parse relay log event entry. The possible reasons are: the


























master's binary log is corrupted (you can check this by running


























'mysqlbinlog' on the binary log), the slave's relay log is corrupted


























(you can check this by running 'mysqlbinlog' on the relay log), a


























network problem, or a bug in the master's or slave's MySQL code. If you


























want to check the master's binary log or slave's relay log, you will be


























able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.






































I can look at the binlog with mysqlbinlog on the master and the slave;


























no errors or problems.


























After a simple "SLAVE START" without having done any changes to the


























database, the slave thread startet again and caught up with the master.






































I've been using mysql's replication-feature since it first came up in


























1999 or 2000 and dealt with lots of problems and workarounds, but this


























one is weird. Any ideas anybody?






































Jan




































--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Aji Andri
*nix forums beginner


Joined: 08 Feb 2005
Posts: 10

PostPosted: Tue Feb 08, 2005 12:01 pm    Post subject: query problem in num_row Reply with quote

here a syntax

$query=&$conn->Execute("select * from itemlocation
where id limit 1 - 50");
$result=mysql_query($query);
$num_result=mysql_num_rows($result);

and error message are syntax error in
$num_result=mysql_num_rows($result); object unknown
can someone please give a direction

all I want to do is comparing data in itemlocation
with a value and if value in item location is smaller
then the value I make then it will appear in a message

Aji



__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Denis Gerasimov
*nix forums beginner


Joined: 01 Mar 2005
Posts: 22

PostPosted: Tue Feb 08, 2005 3:42 pm    Post subject: RE: [PHP-DB] mysqli connection problem Reply with quote

Quote:
Hello,

This question was asked many times, but I can't find a good answer.
I am getting this error message while trying to connect to MySQL server
(PHP
+ PEAR::DB_DataObject):

"Can't connect to local MySQL server through socket '' (111)"

(notice '' - is that right?)

Does anyone have any ideas about how to get rid of this error?

Configuration:
* RedHat Enterprise Linux AS3
* Apache 2.0.46
* PHP 5.0.2
* MySQL 4.1.9, mysqli ext.

Thanks!

[Note: reply-to set to php-db as it's multimailed and I don't see this
as a mysql general issue, nor php general, but feh.]

Well, I don't know the possible reasons for this, so I mailed it to all
suitable lists.

Quote:

Looks to be set blank/null/etc.

You may be slightly tricked by the existence of both of these - from
your standard php.ini...
-----
; Default socket name for local MySQL connects. If empty, uses the built-
in
mysql.default_socket =

; Default socket name for local MySQL connects. If empty, uses the built-
in
; MySQL defaults.
mysqli.default_socket =

Didn't help me. MySQL socket does exist - /var/lib/mysql/mysql.sock (default
location).
mysqli.default_socket is NOT set to null but to this value (manually, as you
advised)

Again,

1. Connection to localhost still fails with message "Can't connect to local
MySQL server through socket '' (111)"

2. Connection to server's domain name fails too (!) with message "Access
denied for user 'user'@'example.com' (using password: YES)"

3. Connection to localhost through mysql shows the following config

mysql> status
--------------
mysql Ver 14.7 Distrib 4.1.9, for pc-linux-gnu (i686)

Connection id: 42
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 4.1.9-standard
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 1 day 3 hours 1 min 7 sec

Threads: 3 Questions: 272 Slow queries: 0 Opens: 64 Flush tables: 1
Open tables: 26 Queries per second avg: 0.003
--------------

Seems to be a security issue... Any more ideas about these symptoms?

Quote:
-----
I can't see any reason why you wouldn't be able to use the same socket -
you're connecting to the same exact server, it's just a path. You
should be perfectly able to set your mysqli.default_socket to the same
as the mysql.default_socket. I can't tell you what the default for your
system is, but there are php functions to get configuration options, if
you don't have it in any obvious places.

Cheers,
--
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=denis.gerasimov@vekos.ru


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Rhino
*nix forums Guru


Joined: 08 Feb 2005
Posts: 449

PostPosted: Tue Feb 08, 2005 4:26 pm    Post subject: Re: Difference between 'LIKE' and '=' Reply with quote

| Hi All,
|
| From what I understand the LIKE keyword allows you to do things like
include
| wildcards and match against regular expressions.
|
| But I have a question: is there any difference between the following?
|
| SELECT lname, fname FROM contacts WHERE lname = 'smith';
| SELECT lname, fname FROM contacts WHERE lname LIKE 'smith';
|
| I'm having difficulty figuring out the difference between these two
queries,
| if there is any. Can someone clarify?
|
| Sincerely,
| -Josh


As long the expression on the right hand side of the equal sign uses no
wildcard characters (% or _), the two WHERE conditions you've written are
functionally equivalent; they should get the same rows for their respective
result sets.

However, there *may* be a performance difference between the two. I don't
know if MySQL treats the two differently in terms of choosing an access path
but DB2 will normally choose a better access path for '=' than 'LIKE',
regardless (I think) of whether the LIKE expression contains wildcards. My
gut hunch is that if your LIKE expression is going to contain no wildcards,
you should probably write it as an '=' simply because it is likely to
perform better.

If anyone reading this is knowledgeable on MySQL performance, please jump in
and correct me if I'm wrong.

Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Ingo Strüwing
*nix forums beginner


Joined: 08 Feb 2005
Posts: 2

PostPosted: Tue Feb 08, 2005 5:33 pm    Post subject: Re: max key file length Reply with quote

Hello,

Am Montag, den 07.02.2005, 17:16 +0000 schrieb sirisha gnvg:
....
Quote:
Thank you for your reply.You suggested me that both
key_reflength and max_key_file_length can be read from "key
file".We just need to find the offset at which they are stored
in "key file".But I have searched all files containing "key"
as part of their name in "MySQL 4.1.9" folder for
"max_key_file_length" and all those files all c or c++ program
files.

Then what do you mean by finding offset?Please once again
explain in detail what "key file" is and what it contains.

A MySQL MyISAM table consists of the files
$DATADIR/databas_name/table_name.frm,
$DATADIR/databas_name/table_name.MYD and
$DATADIR/databas_name/table_name.MYI.
The .MYI file is the file, which contains the indexes. The indexes are
often also called 'keys'. thus, the indexes file is the key file.

Look into myisam/mi_open.c. You will find "kfile=my_open(...)". This is
the place, where the key file is opened. Some lines later
"my_read(kfile,(char*) share->state.header...)" the header structure is
read. See myisam/myisamdef.h, typedef struct st_mi_state_info. This
includes "struct { ... } header". Back to mi_open.c. Some lines later,
"my_seek(kfile,0L,MY_SEEK_SET" the key file is rewound. The next read
starts from the beginning. Now, "my_read(kfile,disk_cache,info_length".
The full fixed part of the key file, including the header, is read.

Important values are picked out of the buffer with
"mi_state_info_read(disk_cache, &share->state)". Some lines later,
"disk_pos=my_n_base_info_read(disk_cache+base_pos, &share->base)", other
important values are extracted. Both functions are also defined in
mi_open.c.

If you can re-use these functions, you are done. Otherwise, you can add
the sizes, which are picked off the buffer in the above functions. So
you get the offset of each value in the file.

If you have a source tree, you will find a file Docs/internals.texi. It
describes, how you can access the 'real' internals.texi. In this file
you find an explanation, how the key file is structured. This may help
you to understand, what you see in the functions mentioned above.

Regards,
Ingo
--
Ingo Strüwing, Senior Software Developer
MySQL AB, www.mysql.com
Office: +49 30 43672407

Are you MySQL certified? www.mysql.com/certification



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Martin Norland
*nix forums beginner


Joined: 07 Feb 2005
Posts: 2

PostPosted: Tue Feb 08, 2005 6:19 pm    Post subject: Re: [PHP-DB] mysqli connection problem Reply with quote

My intention of setting the reply-to was not to offend, or claim you
were wrong - merely to move the discussion to the list I felt (and still
feel - as I've done it again) is most appropriate for the question.

anyway, back to the task at hand

( first: I'm assuming you restarted apache after changing your php.ini -
otherwise, that's your problem. )

Whatever the case, the error message clearly shows that it is not
reading the value, however it's set - because the error is still showing
a blank string for the socket. If it were a permissions problem with
the socket, you wouldn't be getting that exact error - at the very
least, it would still show the correct socket path. More likely, it
would also error with a "cannot open socket" or equivalent.

You may wish to examine ini_get(), ini_get_all(), phpinfo(), or
php_ini_scanned_files(), to verify if it is set, or to see if it's being
overwritten somewhere.

Cheers,

Denis Gerasimov wrote:
Quote:
Didn't help me. MySQL socket does exist - /var/lib/mysql/mysql.sock (default
location).
mysqli.default_socket is NOT set to null but to this value (manually, as you
advised)

Again,

1. Connection to localhost still fails with message "Can't connect to local
MySQL server through socket '' (111)"

2. Connection to server's domain name fails too (!) with message "Access
denied for user 'user'@'example.com' (using password: YES)"

3. Connection to localhost through mysql shows the following config

mysql> status
--------------
mysql Ver 14.7 Distrib 4.1.9, for pc-linux-gnu (i686)

Connection id: 42
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 4.1.9-standard
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 1 day 3 hours 1 min 7 sec

Threads: 3 Questions: 272 Slow queries: 0 Opens: 64 Flush tables: 1
Open tables: 26 Queries per second avg: 0.003
--------------

Seems to be a security issue... Any more ideas about these symptoms?


-----
I can't see any reason why you wouldn't be able to use the same socket -
you're connecting to the same exact server, it's just a path. You
should be perfectly able to set your mysqli.default_socket to the same
as the mysql.default_socket. I can't tell you what the default for your
system is, but there are php functions to get configuration options, if
you don't have it in any obvious places.

Cheers,
--
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=denis.gerasimov@vekos.ru




--
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Chuck Herrick
*nix forums beginner


Joined: 08 Feb 2005
Posts: 3

PostPosted: Tue Feb 08, 2005 8:23 pm    Post subject: Install Question - mysql starts and then stops immediately Reply with quote

Here's hoping you can help.

I have installed Redhat Linux Fedora Core 3, server version from ISO's
burned on 2/2/05.

I have downloaded the latest MySQL 4.1.9-0 rpms, done an rpm -e and
upgraded the MySQL-server, MySQL-client, MySQL-devel and
MySQL-shared. Basically, I followed the instructions in
http://www.whoopis.com/howtos/php5-mysql4-FC3-rpm.html

Invoking /etc/init.d/mysql start does not yeild a running mysqld. In
/var/lib/mysql/<hostname>.err, I see the mysqld start followed by
mysqld stop a second or so later.

invoking /usr/sbin/mysqld --verbose --help returns nothing.

Can anyone help me get MySQL upgraded?

thanks
--
Chuck Herrick
mailto:cherrick@spamcop.net
512 289 0926 (cell)
830 839 4437 (home)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Jeff Smelser
*nix forums beginner


Joined: 04 Feb 2005
Posts: 38

PostPosted: Tue Feb 08, 2005 8:44 pm    Post subject: Re: default values Reply with quote

On Tuesday 08 February 2005 03:32 pm, Emmett Bishop wrote:

Quote:
is it possible to force a field to be NOT NULL but not
have any default value (I.E the insert statement must
explicitly provide data for the field in question)?

of course: col1 int not null

Jeff
Back to top
Ligaya Turmelle
*nix forums beginner


Joined: 08 Feb 2005
Posts: 16

PostPosted: Tue Feb 08, 2005 10:28 pm    Post subject: Re: query problem in num_row Reply with quote

Your not getting a valid result from your query. Add
if (!$result) { echo 'Bad query - message: ' . mysql_error();}

I think it will give you a syntax error on your query. MySQL syntax for
the LIMIT clause is:
Quote:

The LIMIT clause can be used to constrain the number of rows returned by
the SELECT statement. LIMIT takes one or two numeric arguments, which
must be integer constants.

With two arguments, the first argument specifies the offset of the first
row to return, and the second specifies the maximum number of rows to
return. The offset of the initial row is 0 (not 1):

mysql> SELECT * FROM table LIMIT 5,10; # Retrieve rows 6-15


Respectfully,
Ligaya Turmelle

Aji Andri wrote:
Quote:
here a syntax

$query=&$conn->Execute("select * from itemlocation
where id limit 1 - 50");
$result=mysql_query($query);
$num_result=mysql_num_rows($result);

and error message are syntax error in
$num_result=mysql_num_rows($result); object unknown
can someone please give a direction

all I want to do is comparing data in itemlocation
with a value and if value in item location is smaller
then the value I make then it will appear in a message

Aji



__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com


Back to top
Gabriel PREDA
*nix forums addict


Joined: 04 Feb 2005
Posts: 72

PostPosted: Wed Feb 09, 2005 8:08 am    Post subject: Re: Difference between 'LIKE' and '=' Reply with quote

Quote:
| But I have a question: is there any difference between the following?
| SELECT lname, fname FROM contacts WHERE lname = 'smith';
| SELECT lname, fname FROM contacts WHERE lname LIKE 'smith';
| Sincerely,
| -Josh
My
gut hunch is that if your LIKE expression is going to contain no
wildcards,
you should probably write it as an '=' simply because it is likely to
perform better.
If anyone reading this is knowledgeable on MySQL performance, please jump
in
and correct me if I'm wrong.
Rhino

There is nothing wrong...
If you'll use '=' you will get in EXPLAIN SELECT a type of 'ref' and if
you're using 'LIKE' you will get a type of 'range' witch is slower than
'ref'..

I have a table that stores id of a city, ccode is the country code for that
city, and city... is a varchar containing the name of the town... there is
an index '2din3' on 'ccode,city' let's see:

Queries:
EXPLAIN SELECT * FROM `com_cities` WHERE `ccode` LIKE 'EN';
EXPLAIN SELECT * FROM `com_cities` WHERE `ccode` = 'EN';

Results showing only differencies:
type; ref
range; NULL
ref; const

Of course things for me would make no big difference since `ccode` si a 2
letter CHAR... but for a varchar and a big table would !

Gabriel PREDA


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Logan, David (SST - Adela
*nix forums Guru Wannabe


Joined: 07 Feb 2005
Posts: 141

PostPosted: Wed Feb 09, 2005 9:36 pm    Post subject: RE: Header files Reply with quote

Hi Mohsen,

If you install the client libraries from http://www.mysql.com for the
version you wish, this will install the header files in the
mysql/include directory.

Regards

David Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia

+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax


-----Original Message-----
From: Mohsen@ccerelrim03.cce.hp.com
[mailto:Mohsen@ccerelrim03.cce.hp.com] On Behalf Of Mohsen Pahlevanzadeh
Sent: Thursday, 10 February 2005 9:00 AM
To: mysql@lists.mysql.com
Subject: Header files

Dears,
I have started Linux-programming with C++.
I need to header files's name of MySQL.
Please give that's URL.
Yours,Mohsen

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=david.logan@hp.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Mohsen Pahlevanzadeh
*nix forums beginner


Joined: 14 Mar 2005
Posts: 23

PostPosted: Wed Feb 09, 2005 10:01 pm    Post subject: Re: Header files Reply with quote

dear member,
My problem is name of those.When i wish to apply a function,I don't know name
of that's header file.I need to a document for it.
--Mohsen
On Thursday 10 February 2005 02:06, Logan, David (SST - Adelaide) wrote:
Quote:
Hi Mohsen,

If you install the client libraries from http://www.mysql.com for the
version you wish, this will install the header files in the
mysql/include directory.

Regards

David Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia

+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax


-----Original Message-----
From: Mohsen@ccerelrim03.cce.hp.com
[mailto:Mohsen@ccerelrim03.cce.hp.com] On Behalf Of Mohsen Pahlevanzadeh
Sent: Thursday, 10 February 2005 9:00 AM
To: mysql@lists.mysql.com
Subject: Header files

Dears,
I have started Linux-programming with C++.
I need to header files's name of MySQL.
Please give that's URL.
Yours,Mohsen

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=david.logan@hp.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 3 of 67 [996 Posts] Goto page:  Previous  1, 2, 3, 4, 5, ..., 65, 66, 67 Next
View previous topic :: View next topic
The time now is Tue Dec 02, 2008 6:41 am | All times are GMT
navigation Forum index » Databases » MySQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Success delivery report kennykilla Postfix 0 Wed Aug 29, 2007 9:06 am
No new posts Bug Report - Solaris 10 spell Richard B. Gilbert Solaris 0 Fri Jul 21, 2006 11:22 am
No new posts Work-needing packages report for Jul 21, 2006 wnpp@debian.org devel 0 Fri Jul 21, 2006 6:50 am
No new posts Work-needing packages report for Jul 14, 2006 wnpp@debian.org devel 0 Fri Jul 14, 2006 6:50 am
No new posts Work-needing packages report for Jul 7, 2006 wnpp@debian.org devel 0 Fri Jul 07, 2006 6:50 am

Mortgages | Magazine Subscriptions | Mortgage Calculator | Online Loans | Debt Consolidation
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.4286s ][ Queries: 16 (0.2296s) ][ GZIP on - Debug on ]