Re: [gnome-db] SQL Query Types



On Sun, 2003-08-24 at 00:43 +0200, Danilo Schoeneberg wrote:
> > > 
> > > What is the feeling of the team on adding such a thing?
> > > 
> > I am not clear on what exactly you want to add. Could you ellaborate a
> > bit more please?
> 
> php database modules provide a single method to execute queries. in that
> case it would be gda_query() or something and it returns a single result
> set resource. the results can then be evaluated with gda_numrows() or
> gda_affected_rows().
> 
well, that's exactly what gda_connection_execute_command/single_command
does.

> > You can always execute any kind of commands using the
> > gda_connection_execute_command/execute_single_command. You don't
> really
> > need to know what kind of statement it is, unless you want to do some
> > pre-processing.
> 
> well if that behaviour is guaranteed it would be safe to use it - if I
> understood that correctly it should be possible to use the following
> sequence to determine the outcome :
> 
> if (number_of_columns==0) {
>   /* non-query insert,update,delete or similar */ 
> } else {
>   /* select-like query */
> }
> 
> is that correct ?
> 
yes, and if some provider does not do that, it's a bug.

> > If it is a non-query statement, the data model returned will have 0
> > columns, and the number of rows will be the number of rows affected by
> > the statement, as returned by the provider.
> > 
> > So, what is exactly what you are intending to do?
> 
> plan is to have a gda module for php providing the same set of functions
> like the php_mysql extension for instance. That would make websites
> greatly independent from the underlying database. 
> many php systems (like forums or content management systems) have to
> provide their database components as time-consuming
> php-database-wrapppers. a gda module for php would greatly reduce that
> disadvantage. 
> 
yes, I was just asking for the specific thing he wanted to do related to
the execute methods.

cheers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]