On Thu, 18 Aug 2005 20:52, Steve Holdoway wrote:
> On Thu, August 18, 2005 8:18 pm, David Mann said:
> > You're basically right but you've omitted an important point: the
> > order of parameters is often different.
> > eg mysql_query(query_string[, connection]) vs pg_query([connection, ]
> > query_string).
Yeah, I'm guilty of generalising sometimes :)
> > I don't know why but it is a bit annoying as I'm about to convert a
> > MySQL project to PostgreSQL, and a simple search-and-replace would
> > have made it much less time-consuming.
>
> Why not use a function to wrap the mysql_... functions and swaps the
> parameters around to correctly call the pg_ functions? That way, the
> search and replace option becomes viable.
Yeah, I have standard db scripts which have functions like;
db_query($query)
{
return mysql_query($query)
}
Either that or you can use the Pear DB.
hads
--
"I never fail to convince an audience that the best thing they could do
was to go away."