PHP + MySQL, how to get total rows matched when using LIMIT 0, 10?

2002-11-05 Thread SED
I'm trying to get the total matched rows when I'm using LIMIT 0, 10,
but I only get the number 10, when the total should be around 100. So,
can I get total matched rows without doing a separate query using
count()?

Here is an example of my current query:

$result = mysql_query(SELECT * FROM products WHERE price'10' ORDER BY
price LIMIT 0, 10);
$num_rows = mysql_num_rows($result);


Thanks,
Sumarlidi E. Dadason

_
E-mail: [EMAIL PROTECTED]
website: www.sed.is


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Is there a function to sort the result (after using ORDER BY)?

2002-04-12 Thread SED

Hi,

Not yet found anything to cover this on the online-docs so I'm aiming at
you :)

I need to sort the result afterwards e.g.:

SELECT name, date, importance FROM 'mytable' WHERE date'myTime' ORDER
BY date DESC, name LIMIT 0,20;

...then I need to sort *only* the result by the 'importance', can I do
that via MySQL and if so, how?

Thanks,
SED


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Is there a function to sort the result (after using ORDER BY)?

2002-04-12 Thread SED

Thanks for the reply!

Do you mean like .. ORDER BY date DESC, name, importance LIMIT 0,20; ?

If so, I get the result ordered first by date, and if two dates are
equal then the importance takes in. However, I want to get the result
and then sort the result by importance e.g.:

result (date, name, impoartance):

20020102, John, 3;
20020101, Smith, 5;
20010101, Sigmund, 1;
2101, Sigmund, 8;

now I want to sort the result by importance (desc) so the final will be:

2101, Sigmund, 8;
20020101, Smith, 5;
20020102, John, 3;
20010101, Sigmund, 1;

Do you have any way of doing it?

SED

-Original Message-
From: Andrew Hazen [mailto:[EMAIL PROTECTED]] 
Sent: 12. apríl 2002 17:44
To: 'SED'
Subject: RE: Is there a function to sort the result (after using ORDER
BY)?


Just add the field to the Order by clause.  It will be sorted first by
date, and then by importance within each date.

-Original Message-
From: SED [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 12, 2002 1:11 PM
To: [EMAIL PROTECTED]
Subject: Is there a function to sort the result (after using ORDER BY)?

Hi,

Not yet found anything to cover this on the online-docs so I'm aiming at
you :)

I need to sort the result afterwards e.g.:

SELECT name, date, importance FROM 'mytable' WHERE date'myTime' ORDER
BY date DESC, name LIMIT 0,20;

...then I need to sort *only* the result by the 'importance', can I do
that via MySQL and if so, how?

Thanks,
SED


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




How do I select something distinct ordered by most frequent? (e.g. top 10)

2002-02-01 Thread SED

Hi,

I'm trying to make a query where I select something distinct ordered by
most frequent?

I found below example from the manual but I can not figure out how I
should order them by most frequent - do you know how? 

SELECT DISTINCT owner FROM pet

Regards,
SED


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




[OT] Javascript Manual

2001-06-07 Thread SED

Hi, I know this is off topic but does anyone here know of a good manual
website which shows Javascript from A-Z (like the PHP-manual and
MySQL-manual). I know of a lot of java-code sites but none of them show
the basic thought, syntaxes etc. - so can anyone pin-point me?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is
--


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: is PHP list dead?

2001-05-30 Thread SED

If you check out the www.php.net you will find out it temporally out of
order. I sure hope it will be up soon :)

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is
--

-Original Message-
From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]]
Sent: 30. maí 2001 17:13
To: MySQL List
Subject: is PHP list dead?


I know this is not a mySQL question, but I've not received any PHP List
emails in two to three days...  I'm willing to bet that somebody here is
also on that list as well... is it dead?

Joseph E. Sheble
a.k.a. Wizaerd
Wizaerd's Realm
Canvas, 3D, Graphics,
PHP/mySQL  ColdFusion/MSSQL
http://www.wizaerd.com
=
The Canvas Expert Online
The #1 Resource For Canvas Information
http://www.TheCanvasExpert.com
=


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Is any limit on how many tables one database can have?

2001-04-20 Thread SED

Hi,

I'm designing a database and I was wandering which one is better:

A)  1000 tables (e.g. 10,000 rows each) in one database

or

B)  One table with (e.g. 10,000,000 rows) and each group with special ID (in
one extra column)


And if I need to have many tables in one database, is any limit on how many
tables one database can have?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is - New Homepage!
--


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Are all SQL-databases based on the same query-language?

2001-01-31 Thread SED

Hi,

I have only used MySQL. Today I read that all SQL use the same
query-language, so if you program something, e.g. in PHP, you can also use
is with other SQL-databases, with perhaps minor adjustments for the
database-connections.

Is this true?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is - New Homepage!
--




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Can I have two (or more) different SQL-databases on the same server?

2001-01-31 Thread SED

Hi,

Can I have two (or more) different SQL-databases running at the same time on
the same server (or same computer)? Does it varies between the systems?

And if I can, are they all available to PHP at the same time?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is - New Homepage!
--


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




The function of auto_increment and Premier Key?

2001-01-19 Thread SED

Hi I'm relatively new to MySQL though I familiar to other simple databases.
I have been reading the manual but not doing well understanding the function
of auto_increment and Premier Key.

Lets say I have a table with a few columns. One of them is an ID with
auto_increment. It has 1000 rows. If I delete row #500 to #599 (total of
100), will the MySQL update the ID value for row #600 to #1000, or will it
stay as it was?

If it stays as it was, and afterwards when I add a row (or record), will it
continue from row #1001 or will it use the value from #500 to #599?

What is the Primary Key used for and how does it work? Do I need it if I
have a row ID like mentioned above?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is - New Homepage!
--


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php