php script is not work in MSQL database

Hello Member My question is different i am work different web site some time create problem i am help you. this time a create a problem i asked you. i am make a database who name is script i am crate table in am insert PHP script in this and result show in PHP page.
For Example :

<?php $db = mysql_connect("localhost", "root", ""); mysql_select_db("scritp",$db); ?>

create a table “script”

i am put PHP code in script and i am show PHP work in page using the php script.
thanks

you want to create a database called ‘script’?

no i am insert PHP code in script (MSQL) and php code work in php.

you want to insert php codes in a database code ‘script’?

i am insert in PHP code in database.

For Example:
user name : root
database name: script

table insert row
CREATE TABLE showpage (
id int(10) NOT NULL auto_increment,
post text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM AUTO_INCREMENT=0 ;

make table ok

i insert PHPscript in table of “post”
i insert this PHP script

<?php require('up1.php'); require('config.php'); $id = $_GET["fid"]; ?>
<?php require('table.php'); ?>
<?php $sql = "Select * from showpage where fid=$id"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ ?> <?PHP echo $row["post"] ?>
<?php } ?>
<?php require('user/tabledown.php'); ?>

save in table above code.

i create a php page who name is checkcode.php
i simple insert code only show record in id “1” of table “post”.
when i am open this page. Page work PHP command. thinks.

showpage its means post

I found one mistake with you query. it should be
[php]
$sql = “Select * from showpage whereid=$id”;
[/php]

becuase id is the of the id field name in your database NOT fid

just replace your query with mine and it should work

Sponsor our Newsletter | Privacy Policy | Terms of Service