g4ckt Posted April 6, 2011 Share Posted April 6, 2011 Hi Everyone, I have a class in which I was asked to implement PHP to access a PostGresSQL database and connect it to forms and such. The issue is, is that I don't even know how to start the PHP stuff. Are there any debuggers and things for PHP coding because I tried to just do it in notepad and open in in explorer but it didn't work. I know I need the PHP files and I've been trying to find a web host that has pg_connect() but I can't seem to find any free ones. Any help is great Thanks Quote Link to comment https://forums.phpfreaks.com/topic/232907-new-to-php-need-help-xd/ Share on other sites More sharing options...
Pikachu2000 Posted April 6, 2011 Share Posted April 6, 2011 Don't use Notepad, it sucks. There are several free IDEs out there that provide functionality such as syntax highlighting and XDebug plugin capability. Eclipse and NetBeans are a couple that come to mind. You won't be able to just write a PHP script and open it in IE and have it work. PHP code needs to be processed by a webserver so the php code is parsed by a php interpreter. I don't know about Postgres, but there are several packages that include PHP, Apache web server and MySQL as a bundle. XAMPP and WAMP are 2 such bundles for WinD'ohs. To find a host, you'll just have to do some research. Quote Link to comment https://forums.phpfreaks.com/topic/232907-new-to-php-need-help-xd/#findComment-1197893 Share on other sites More sharing options...
jedeye Posted April 27, 2011 Share Posted April 27, 2011 I was in this situation also recently... - Install Linux Distro of your choice (pref Ubuntu) - Install Apache2 - Install mod_php for Apache2 - Install PostgreSQL - Install PG Admin3 (Frontend for Postgres, similar to phpMyAdmin) Then test away on your localmachine. There are several tutorials out there to walk you through those above steps. I like recommend "BlueFish" as and IDE. It has lovely syntax highlighting, recommendations when you start typing pre-defined functions, and its open-source. Quote Link to comment https://forums.phpfreaks.com/topic/232907-new-to-php-need-help-xd/#findComment-1207107 Share on other sites More sharing options...
Roelandje Posted November 28, 2011 Share Posted November 28, 2011 In order to see if your script works, You need three things: - A database, in your case PostgreSQL - PHP - A server, use Apache. If you dont have any idea of what you;re doing, i suggest you download the WAPP-server. It's one package that installs everything for you. Postgres, PHP and Apache. To learn the basics of PHP, just download or buy PHP for Dummies. In the end, its all logics and if you basically know whats happening in a PHP script, you can always try to make sense of it. Google helps a lot too. The code to connect to a database in postgres from PHP is pg_connect(''). So if you google that, you'll find a tutorial about it. It's a hobby with a load of trial an' error. But the sensation when you get things to work is ridiculously satisfying. I wish you the best of luck. Oh and PS. Notepad sucks. I use Dreamweaver from Adobe to make my PHP, but offcourse you have to buy the program. I suggest you download ConTEXT. It's free and it works fine. Quote Link to comment https://forums.phpfreaks.com/topic/232907-new-to-php-need-help-xd/#findComment-1291914 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.