On Thu, August 18, 2005 8:18 pm, David Mann said: > On Aug 18, 2005, at 6:57 PM, Hadley Rich wrote: > >> It's much the same as using MySql, just replace mysql_ with pg_ i.e. >> >> mysql_fetch_array() becomes pg_fetch_array() > > 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). > > 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.
Steve -- Windows: Where do you want to go today? MacOS: Where do you want to be tomorrow? Linux: Are you coming or what?
