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 Quote 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. Quote 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? Quote 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. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/210616-mysql-php-commands-question/#findComment-1098763 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.