![]() |
Outputting PHP code from MySQL
Hi All,
I am storing some PHP code in a MySQL table for inclusion on a page. My problem is that, when the page calls the content for the page, it's as if the PHP doesn't exist... nothing happens! Being a newbie to MySQL, I have no clue why this is (or, more precisely!) isn't happening. Can someone give me a tip?? Thanks in advance. |
Actually I have knowledge of coding but for gaming apps. So not more info by me. I hope someone will help you.
|
Can you give us an example of the code you are using and the query?
|
PHP code in mysql will not work, unless you need to re-execute in the server
|
I know the bascis only.. i dono the whole funtionality
|
Can you share code with us?
|
Sorry But What you are talking about???????
This is very strange, if you want to include any php code or call it, you have to create either functions or classes (Objects), you must save data types only in Mysql Database, e.g if you want to retrieve some text, read about object oriented php. (Database is to store data only not code)
|
if you want to store any code as data you must put it as text and then in the view you can put
example in index.php $query = "SELECT * FROM some_table WHERE anything = anything"; $results = mysql_query($query); ---->will get you the php code you stored as text while ($text = mysql_fetch_array($results)) { echo " echo $text['php']; echo "?>"; } the result will be some php code here ?> but as i said it will be represented as text not as code to run |
All times are GMT -7. The time now is 07:44 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.