Current location: Hot Scripts Forums » Programming Languages » PHP » retrive php code from sql database and run as php code with in the web site


retrive php code from sql database and run as php code with in the web site

Reply
  #1 (permalink)  
Old 11-08-11, 04:28 PM
togetherwephpit togetherwephpit is offline
New Member
 
Join Date: Nov 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up retrive php code from sql database and run as php code with in the web site

retrive php code from sql database and run as php code within the web site

i have built part of my site in the myphpadmin in a sql database

i want to be able to change headers and and part of my php web site left and right mainly

i have previously uploaded the images to my server

i have added this code to my sql database file

<body>
<center><IMG SRC="images/HEADER.jpg" BORDER=0>
</center>
</Body>

my database is called 115559
my table is called buildsite
my field is called header (this is where the above data is stored) type soterd as TEXT
field is called id 1 int(11)

i have connected to the server if i put the sql server details in correct i get a white screen
if i put the password in incorrect i get the error screen so im belive im correcting correctly

i just carnt seem to extract the code from the data and run it as part of the php script

any help please
Reply With Quote
  #2 (permalink)  
Old 11-08-11, 04:35 PM
togetherwephpit togetherwephpit is offline
New Member
 
Join Date: Nov 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
this isent the answer but i dont think its far from

<?php
include("config.php");
include("connect_db.php");

$query = "SELECT * FROM sitebuild WHERE header ";
$result = mysql_query($query);
$row = mysql_fetch_row($result);

...
$content = $row3[1];
...
echo $content;
?>
i thought this could be the right code but i only get a white screen
and not the header

any help would be great
Reply With Quote
Reply

Bookmarks

Tags
code, database, extract, php, sql


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

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiring PHP Developer codestrong Job Offers & Assistance 5 08-15-11 03:43 PM
ASP or PHP which is better? nepala The Lounge 9 07-14-10 05:48 AM
How Can i connect sql database with php? I'm New in PHP zahid PHP 1 06-01-04 10:12 AM


All times are GMT -5. The time now is 08:53 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.