p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: mysql vs access (odbc)


Message #1 by "The Veales" <bveale@t...> on Wed, 13 Feb 2002 23:35:05 -0700
This is a multi-part message in MIME format.



------=_NextPart_000_0029_01C1B4E7.10BECF70

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Mysql has a 'limit' function that will limit a query to a specified 

number of results. Is there a way to get php to limit the odbc query the 

same way? I just can't see it myself. I read something about SET 

ROWCOUNT but I can't figure out where that would go. It doesn't seem to 

work within the sql statement itself. The odbc chapter in the book is 

very sparse.



Thanks

Bob






Message #2 by David Cameron <dcameron@i...> on Thu, 14 Feb 2002 17:44:26 +1100
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C1B523.0BA414F0

Content-Type: text/plain;

	charset="iso-8859-1"



Access (I assume you mean MS Access) is *not* ODBC. ODBC or Open Database

Connectivity is way of connecting to the database. Access is a database that

you can connect to using ODBC or OLEDB (which is actually faster than ODBC,

but you might need to use ADO to access it). ADO is an MS COM object that

provides an interface to databases and data stores.



I have only seen ROWCOUNT used in procs, unless you have a RDBMS that has

procs (SQL Server, Oracle, DB2) I don't think you can use that. Have you

tried using TOP? TOP is certainly supported by Access and is in fact apart

of the SQL-92 standard (LIMIT is not part of the standard).



eg.



SELECT TOP 4 UserID, txtFName, txtLName

FROM tblUsers

ORDER BY dtmDateAdded DESC



would return the top 4  most recent users from your users table.



regards

David Cameron

nOw.b2b

dcameron@i...




Message #3 by "Andrew" <andrew@s...> on Thu, 14 Feb 2002 09:56:19 -0500
This is a multi-part message in MIME format.



------=_NextPart_000_0301_01C1B53D.DA100500

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: 7bit



Bob,



You should probably look into Cursors - a decent ODBC driver will support

cursors that allow you to fetch the results into a cursor and then iterate

over the cursor to retreive them.



Best regards,

Andrew Hill

Director of Technology Evangelism

http://www.openlinksw.com/virtuoso/whatis.htm

OpenLink Virtuoso Internet Data Integration Server



  -----Original Message-----

  From: The Veales [mailto:bveale@t...]

  Sent: Thursday, February 14, 2002 1:35 AM

  To: beginning php

  Subject: [beginning_php] mysql vs access (odbc)





  Mysql has a 'limit' function that will limit a query to a specified number

of results. Is there a way to get php to limit the odbc query the same way?

I just can't see it myself. I read something about SET ROWCOUNT but I can't

figure out where that would go. It doesn't seem to work within the sql

statement itself. The odbc chapter in the book is very sparse.



  Thanks

  Bob




$subst('Email.Unsub').








Message #4 by "Hermawan Haryanto" <hermawan@h...> on Thu, 14 Feb 2002 22:14:04 +0700
This is a multi-part message in MIME format.



------=_NextPart_000_001A_01C1B5A4.E9A31E50

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Sorry to interrupt,

I didn't read the last message coz my harddrive is crash.

as I know to get limitation of query result on access you got to use 

this kinda sql statement:

"SELECT TOP n * FROM table WHERE condition=3Dvalue";

on MySQL:

"SELECT * FROM table WHERE condition=3Dvalue LIMIT 0,3";

I don't know if it's asked or not, just trying to help



Thanks



Hermawan Haryanto

hermawan@h...

  ----- Original Message -----

  From: Andrew

  To: beginning php

  Sent: Thursday, February 14, 2002 9:56 PM

  Subject: [beginning_php] RE: mysql vs access (odbc)





  Bob,

  

  You should probably look into Cursors - a decent ODBC driver will 

support cursors that allow you to fetch the results into a cursor and 

then iterate over the cursor to retreive them.

  

  Best regards,

  Andrew Hill

  Director of Technology Evangelism

  http://www.openlinksw.com/virtuoso/whatis.htm

  OpenLink Virtuoso Internet Data Integration Server



    -----Original Message-----

    From: The Veales [mailto:bveale@t...]

    Sent: Thursday, February 14, 2002 1:35 AM

    To: beginning php

    Subject: [beginning_php] mysql vs access (odbc)





    Mysql has a 'limit' function that will limit a query to a specified 

number of results. Is there a way to get php to limit the odbc query the 

same way? I just can't see it myself. I read something about SET 

ROWCOUNT but I can't figure out where that would go. It doesn't seem to 

work within the sql statement itself. The odbc chapter in the book is 

very sparse.

    

    Thanks

    Bob




$subst('Email.Unsub').




$subst('Email.Unsub').






Message #5 by David Cameron <dcameron@i...> on Fri, 15 Feb 2002 09:07:19 +1100
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C1B5A3.F8855970

Content-Type: text/plain;

	charset="iso-8859-1"



Cursors are slow. If you can do your set based work with SQL then you will

find it is much faster than using something procedural, ie cursors.



regards

David Cameron

nOw.b2b

dcameron@i...



>  -----Original Message-----

> From: 	Andrew [mailto:andrew@s...] 

> Sent:	Friday, 15 February 2002 1:56 AM

> To:	beginning php

> Subject:	[beginning_php] RE: mysql vs access (odbc)

> 

> Bob,

>  

> You should probably look into Cursors - a decent ODBC driver will support

cursors that allow you to fetch the results into a cursor and then iterate

over the cursor to retreive them.

>  

> Best regards,

> Andrew Hill

> Director of Technology Evangelism

> <http://www.openlinksw.com/virtuoso/whatis.htm>

> OpenLink Virtuoso Internet Data Integration Server 

> 

> -----Original Message-----

> From: The Veales [mailto:bveale@t...]

> Sent: Thursday, February 14, 2002 1:35 AM

> To: beginning php

> Subject: [beginning_php] mysql vs access (odbc)

> 

> 

> Mysql has a 'limit' function that will limit a query to a specified number

of results. Is there a way to get php to limit the odbc query the same way?

I just can't see it myself. I read something about SET ROWCOUNT but I can't

figure out where that would go. It doesn't seem to work within the sql

statement itself. The odbc chapter in the book is very sparse.

>  

> Thanks

> Bob




$subst('Email.Unsub'). 

> 




$subst('Email.Unsub'). 





  Return to Index