Re: [phpslash-users] abstracting DB calls
Brought to you by:
joestewart,
nhruby
From: nathan r. h. <nh...@ar...> - 2000-10-05 00:21:13
|
On Thu, 5 Oct 2000, e. pareja wrote: > hi all, > > i managed to mangle the slash-structure.sql file enough to get phpslash to > work with PostgreSQL. however, i noticed that some of the attributes being > compared in the php scripts would result in type errors. notably, varchars > being compared with ints. i don't know how MySQL handles types, and it > would seem that it is less strict than PostgreSQL about type conflicts > like these. > > is there any reason why the *_id attributes are varchar(32) in some > tables, then int(11) or some other int in others? > This is leftover from when we were using md5 hases as keys. they should all be int's soon. if you have a patch, please point it at the SourceForge Patch Manager > can we clean the SQL structure up so that type conflicts don't crop up? > this would bring phpslash-ft a step forward toward abstracting database > calls. > > in another area, one of the non-standard SQL functions that i run into > "trouble" with when converting the MySQL code to PostgreSQL code is > dateformat(). all i did presently was to flag the code where dateformat() > exists, and introduced a global $dbtype. i then set up a conditional/case > structure that would handle the different $dbtype values ("My", "Pg", > "MS", "Or", "Sy", etc.) and give them the appropriate dateformat function > equivalent. since my intent was just to get phpslash working, i left out > the dateformat functionality altogether and got the queries to work. > > can we move the formatting of the datetime/timestamp attributes out of the > SQL queries? is there a standard format for date/time that the databases > output that we can adopt in the SQL outputs then mangle it with PHP after > the SQL query? that way, formatting is taken out of the database calls and > handled by the template system as well. > Thsi should all be done soon. IF you have the current CVS, take a look at doc/roadmap.txt we do plan on being db agnostic for 0.7, so right now it's not a high priorty, though if you've got the code, again, send it to the patch manager and we'll see what we can do with it. -n -- ........ nathan hruby Webmaster: UGA Department of Drama and Theatre Project Maintainer: phpSlash, Carousel nh...@ar... ........ |