kratsg Posted August 13, 2010 Share Posted August 13, 2010 Hey guys, This is probably the best board I can seem to find for this question. Given the whole slew of mysql_xxxxx() functions, can I replace "mysql" with "pg" and expect it to work properly with a Postgres DB? ~kratsg Link to comment https://forums.phpfreaks.com/topic/210616-mysql-php-commands-question/ Share on other sites More sharing options...
trq Posted August 13, 2010 Share Posted August 13, 2010 Not likely. Some thing will work, some won't. Link to comment https://forums.phpfreaks.com/topic/210616-mysql-php-commands-question/#findComment-1098759 Share on other sites More sharing options...
kratsg Posted August 13, 2010 Author Share Posted August 13, 2010 Let me better phrase this question... Let's say I focus on some of the more commonly used functions in mysql: mysql_connect, mysql_select_db, mysql_query, mysql_fetch_result/array, mysql_real_escape_string, mysql_free_result... It appears that almost all of these exist, except for the "pg"_real_escape_string. Is there a replacement for this or a way to prevent SQL Injection similarly with postgres? Link to comment https://forums.phpfreaks.com/topic/210616-mysql-php-commands-question/#findComment-1098760 Share on other sites More sharing options...
trq Posted August 13, 2010 Share Posted August 13, 2010 pg_escape_string. Link to comment https://forums.phpfreaks.com/topic/210616-mysql-php-commands-question/#findComment-1098762 Share on other sites More sharing options...
kratsg Posted August 13, 2010 Author Share Posted August 13, 2010 Thanks Thorpe. In retrospect, that seemed fairly stupid of me. "Only" mysql had to have the 'real' part. Link to comment https://forums.phpfreaks.com/topic/210616-mysql-php-commands-question/#findComment-1098763 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.