Jump to content

New to PHP need help xD


g4ckt

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...

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.

Link to comment
Share on other sites

  • 7 months later...

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.