Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 09-06-2011, 12:14 AM   #1
ncjbhd
Registered User
 
Join Date: Jul 2011
Posts: 262
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ncjbhd is offline   Reply With Quote

Old 09-13-2013, 10:36 AM   #2
henryhill108
Registered User
 
Join Date: Sep 2013
Location: France
Posts: 20
Actually I have knowledge of coding but for gaming apps. So not more info by me. I hope someone will help you.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
that gives PSN card. Get your
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
/Playstation Network card here fast!
henryhill108 is offline   Reply With Quote
Old 09-14-2013, 03:23 AM   #3
therapyportal
Registered User
 
Join Date: Sep 2013
Posts: 5
Can you give us an example of the code you are using and the query?
therapyportal is offline   Reply With Quote
Old 10-16-2013, 08:43 AM   #4
Ranjan123
Registered User
 
Join Date: Oct 2013
Posts: 15
PHP code in mysql will not work, unless you need to re-execute in the server
Ranjan123 is offline   Reply With Quote
Old 03-17-2014, 05:23 AM   #5
alligatortek001
Registered User
 
Join Date: Nov 2013
Posts: 92
I know the bascis only.. i dono the whole funtionality
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
alligatortek001 is offline   Reply With Quote
Old 03-21-2014, 03:15 AM   #6
milos87popovic
Registered User
 
Join Date: Dec 2013
Posts: 137
Can you share code with us?
__________________
Visit my site for
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
milos87popovic is offline   Reply With Quote
Old 03-21-2014, 05:32 AM   #7
mikhapop
Registered User
 
Join Date: Mar 2014
Posts: 19
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)
__________________
Mega Business Solutions!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mikhapop is offline   Reply With Quote
Old 03-21-2014, 05:37 AM   #8
mikhapop
Registered User
 
Join Date: Mar 2014
Posts: 19
if you want to store any code as data you must put it as text and then in the view you can put <?php and ?>

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 "<?php";
echo $text['php'];
echo "?>";
}


the result will be
<?php
some php code here
?>

but as i said it will be represented as text not as code to run
__________________
Mega Business Solutions!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mikhapop is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:25 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.