Hello
I try to display content stored in my DB by using the following scripts
The first script (till capital letters) is called getdata.php
And works fine if I want to retrieve an image
However I now try to display text content in a table by using the very last line of that post bellow the capital text.
I cannot remember how to properly call the text by using its ID as the "trial" shows below
Thank you
regards
<?php
if($id) {
mysql_connect("-------"
;
mysql_checkerror();
mysql_select_db("------"
;
mysql_checkerror();
$query = "select page_content from ----- where ----_id=$id";
$result = mysql_query($query);
$data = mysql_result($result,0,"-----t"
;
Header("Content-type: text/php"
;
echo $data;
}
// functions
function mysql_checkerror(){
$err_no=mysql_errno();
if ($err_no > 0 ){
echo "<h2> Error:</h1> " . mysql_errno() . ": " . mysql_error() . "<br>\n";
exit;
}
}
?>
IN A WEB PAGE: TO DISPLAY CONTENT STORED IN THE DB
echo '<a href="getdata.php?id=2">';
I try to display content stored in my DB by using the following scripts
The first script (till capital letters) is called getdata.php
And works fine if I want to retrieve an image
However I now try to display text content in a table by using the very last line of that post bellow the capital text.
I cannot remember how to properly call the text by using its ID as the "trial" shows below
Thank you
regards
<?php
if($id) {
mysql_connect("-------"
mysql_checkerror();
mysql_select_db("------"
mysql_checkerror();
$query = "select page_content from ----- where ----_id=$id";
$result = mysql_query($query);
$data = mysql_result($result,0,"-----t"
Header("Content-type: text/php"
echo $data;
}
// functions
function mysql_checkerror(){
$err_no=mysql_errno();
if ($err_no > 0 ){
echo "<h2> Error:</h1> " . mysql_errno() . ": " . mysql_error() . "<br>\n";
exit;
}
}
?>
IN A WEB PAGE: TO DISPLAY CONTENT STORED IN THE DB
echo '<a href="getdata.php?id=2">';