0

It is my first time using PHP in database tables. Situation: I have a table with varchar field which I fetch on my home page. The HTML works but when I try to use PHP it isnt executing. Instead of that when I use "View Source" in FF it is colored with pink. What should I do? Thanks in advance!

George
  • 5
  • 1
  • 3
  • 2
    You need to set up your web-server correctly. This is very platform-dependent, and would be better off at http://http://webmasters.stackexchange.com/. – Oliver Charlesworth Aug 23 '11 at 16:32
  • 5
    Let me get this right: you're trying to execute php code you store in a database? Don't do that: http://stackoverflow.com/questions/41406/how-do-i-execute-php-that-is-stored-in-a-mysql-database – Luwe Aug 23 '11 at 16:34

1 Answers1

0

PHP requires you to have a PHP capable server setup. A good one would be Apache 2 with PHP (which is quite common and runs on all). Search Google to find how to set it up according to your OS. If you are trying to store code in a DB then run it in PHP, like Luwe said, don't do it. It could open security risks and I don't think it works in general.

Travis Pessetto
  • 3,260
  • 4
  • 27
  • 55
  • So I suppose that I should use another methods. Thanks for the reply. – George Aug 23 '11 at 17:10
  • @George Yes, use regular php files. Use require or include if you need to execute the code in the database. If you are allowing users to put in code well, I would strongly suggest against it. They can turn the PHP against you as it can read and write to your server and other things. – Travis Pessetto Aug 23 '11 at 17:43