My data does not show up in web pages PHP

Hi I'm using Dreaweaver (gasp!) to set up a web page displaying data from a mySQL database.
The connection works fine and when tested it retrieves data correctly. When I upload the file no data appears.
Any ideas?
<?php echo $row_rsSubPages['subPage_Content']; ?>

Open in new window

LVL 5
cokefourAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

profyaCommented:
Add this code to your page:
error_reporting(E_ALL);
to see what's going on.
0
profyaCommented:
1) Make sure using PHPMyAdmin for example that the database has successfully created and it contains the data.
2) If you are using non-standard plugins make sure that they have been enabled.
0
cokefourAuthor Commented:
It says "Parse error: syntax error, unexpected T_IF in /home/fhlinux133/b/bluefonteinventures.com/user/htdocs/aboutus.php on line 4"
that's the line below

if (!function_exists("GetSQLValueString")) {

Open in new window

0
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

profyaCommented:
May be there is a missing semi-colon or bracket in the line above. Line 4 is good for me.
0
cokefourAuthor Commented:
This came up after I put a semi colon after the error reporting line

Notice: Array to string conversion in /home/fhlinux133/b/bluefonteinventures.com/user/htdocs/aboutus.php on line 8

LINE 8 BELOW
 $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

Open in new window

0
profyaCommented:
It is a notice, not an error, however, If $theValue is array then you should not use stripslashes.
0
cokefourAuthor Commented:
no plug ins the database is populated, checked it in Dreamweaver still no data showing
0
profyaCommented:
All errors disappeared?
0
cokefourAuthor Commented:
no errors
0
profyaCommented:
Please submit:
Page source generated (HTML code generated from the browser)
The source code of the php page, with access information and other sensitive information removed
0
cokefourAuthor Commented:
that's the source code, design time then runtime under it

<?php include('Connections/connBlue.php'); ?>
<?php
error_reporting(E_ALL);
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$colname_rsSubPages = "1";
if (isset($_GET['subPages_id'])) {
  $colname_rsSubPages = $_GET['subPages_id'];
}
mysql_select_db($database_connBlue, $connBlue);
$query_rsSubPages = sprintf("SELECT * FROM subPages WHERE subPages_id = %s", GetSQLValueString($colname_rsSubPages, "int"));
$rsSubPages = mysql_query($query_rsSubPages, $connBlue) or die(mysql_error());
$row_rsSubPages = mysql_fetch_assoc($rsSubPages);
$totalRows_rsSubPages = mysql_num_rows($rsSubPages);
 
$MMColParam_rsSubPages = "$_REQUEST";
if (isset($_REQUEST)) {
  $MMColParam_rsSubPages = $_REQUEST;
}
mysql_select_db($database_connBlue, $connBlue);
$query_rsSubPages = sprintf("SELECT * FROM subPages WHERE subPages.subPages_Parent = '/aboutus.php' AND subPages.subPages_id =' %s'", GetSQLValueString($MMColParam_rsSubPages, "int"));
$rsSubPages = mysql_query($query_rsSubPages, $connBlue) or die(mysql_error());
$row_rsSubPages = mysql_fetch_assoc($rsSubPages);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>About Bluefontein Ventures - <?php echo $row_rsSubPages['subPage_Title']; ?></title>
<link href="/bluefontein2009.css" rel="stylesheet" type="text/css" />
<link href="p7pmm/p7PMMh10.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="p7pmm/p7PMMscripts.js"></script>
</head>
 
<body>
<div id="wrapper">
  <div class="masthead" id="homemast"><img src="/images/aboutmasthead.jpg" width="804" height="74" alt="bluefontein masthead" /></div>
<div id="p7PMM_1" class="p7PMMh10">
    <ul class="p7PMM">
      <li><a href="/index.php" class="p7PMM_img"><img src="/images/nav/home.jpg" width="160" height="25" alt="home" /></a></li>
      <li><a href="/aboutus.php" class="p7PMM_img"><img src="/images/nav/about.jpg" width="160" height="25" alt="about the company" /></a></li>
      <li><a href="/ourservices.php" class="p7PMM_img"><img src="/images/nav/services.jpg" width="160" height="25" alt="our services" /></a></li>
      <li><a href="/projects.php" class="p7PMM_img"><img src="/images/nav/projects.jpg" width="160" height="25" alt="project portfolio" /></a></li>
      <li><a href="/contactus.php" class="p7PMM_img"><img src="/images/nav/contact.jpg" width="160" height="25" alt="contact us" /></a></li>
    </ul>
<div class="p7pmmclearfloat">&nbsp;</div>
    <!--[if lte IE 6]>
<style>.p7PMMh10 ul ul li {float:left; clear: both; width: 100%;}.p7PMMh10 {text-align: left;}.p7PMMh10, .p7PMMh10 ul ul a {height: 1%;}</style>
<![endif]-->
    <!--[if IE 5.500]>
<style>.p7PMMh10 {position: relative; z-index: 9999999;}</style>
<![endif]-->
    <!--[if IE 7]>
<style>.p7PMMh10, .p7PMMh10 a{zoom:1;}.p7PMMh10 ul ul li{float:left;clear:both;width:100%;}</style>
<![endif]-->
    <script type="text/javascript">
<!--
P7_PMMop('p7PMM_1',1,2,-5,-5,0,1,0,1,2,3,1,1,0);
//-->
    </script>
  </div>
<div id="p7PMM_2" class="p7PMMh10">
    <ul class="p7PMM">
      <li><a href="#" class="p7PMM_img"><img src="/images/nav/blank.jpg" width="160" height="25" alt="" /></a></li>
      <li><a href="/aboutus.php?subPage_ID=1" class="p7PMM_img"><img src="/images/nav/company.jpg" width="160" height="25" alt="company background" /></a></li>
      <li><a href="aboutus.php?subPages_id=3" class="p7PMM_img"><img src="/images/nav/mission.jpg" width="160" height="25" alt="" /></a></li>
      <li><a href="/healthandsafety.php" class="p7PMM_img"><img src="/images/nav/healthandsafety.jpg" width="160" height="25" alt="health and safety policy" /></a></li>
      <li><a href="/qualitypolicy.php" class="p7PMM_img"><img src="/images/nav/quality.jpg" width="160" height="25" alt="quality policy" /></a></li>
    </ul>
<div class="p7pmmclearfloat">&nbsp;</div>
    <!--[if lte IE 6]>
<style>.p7PMMh10 ul ul li {float:left; clear: both; width: 100%;}.p7PMMh10 {text-align: left;}.p7PMMh10, .p7PMMh10 ul ul a {height: 1%;}</style>
<![endif]-->
    <!--[if IE 5.500]>
<style>.p7PMMh10 {position: relative; z-index: 9999999;}</style>
<![endif]-->
    <!--[if IE 7]>
<style>.p7PMMh10, .p7PMMh10 a{zoom:1;}.p7PMMh10 ul ul li{float:left;clear:both;width:100%;}</style>
<![endif]-->
    <script type="text/javascript">
<!--
P7_PMMop('p7PMM_2',1,2,-5,-5,0,1,0,1,2,3,1,1,0);
//-->
    </script>
  </div>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td width="161"><img src="/images/aboutmainimage.jpg" width="161" height="250" alt="global reach" /></td>
      <td width="639" valign="top"><p><?php echo $row_rsSubPages['subPage_Content']; ?><?php echo $row_rsSubPages['subPage_Title']; ?></p></td>
    </tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="1">
  <tr>
    <th width="275">The Team</th>
    <th width="275">Our Technical Partners</th>
    <th>Work With Us</th>
  </tr>
  <tr>
    <td width="275" valign="top" bgcolor="#CDAE84"><p>Mr Sokpiri Graham-Douglas - Managing Director</p>
    <p>Mr Olayinka Coker - General Manager</p></td>
    <td width="275" valign="top" bgcolor="#A4A3CB"><p>Bluefontein Ventures Ltd when necessary  enters in to partnership with some other companies<br />
      For most of its technical jobs. A few  examples are Fadicom International (Electrification/Electrical Engineering)  Hado Construction and Darycet International (Civil Engineering works) </p></td>
    <td valign="top"><p>If you are interested in a career at Bluefontein or would like to partner with us please fill in the form below and we will be in touch to discuss mutual benefits with you.</p>
      <form id="form1" name="form1" method="post" action="">
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
          <tr>
            <td align="left" valign="top"><label>Name</label></td>
            <td align="left" valign="top"><input type="text" name="txtName" id="txtName" tabindex="1" /></td>
          </tr>
          <tr>
            <td align="left" valign="top"><label>Email</label></td>
            <td align="left" valign="top"><input type="text" name="txtEmail" id="txtEmail" tabindex="2" /></td>
          </tr>
          <tr>
            <td align="left" valign="top"><label>Enquiry</label></td>
            <td align="left" valign="top"><textarea name="txtMessage" id="txtMessage" cols="25" rows="5" tabindex="3"></textarea></td>
          </tr>
          <tr>
            <td align="left" valign="top">&nbsp;</td>
            <td align="left" valign="top"><input type="submit" name="Submit" id="Submit" value="Submit" tabindex="4" /></td>
          </tr>
        </table>
      </form>
      <p>&nbsp;</p></td>
  </tr>
</table>
 
  <table width="100%" border="0" cellpadding="0" cellspacing="0" id="footer">
  <tr>
    <td bgcolor="#005245">Terms of Use | Privacy Statement | Contact Us | Site Credits</td>
  </tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($rsSubPages);
?>
 
*/ /////////////////////////////////////////////////*
 
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>About Bluefontein Ventures - </title><link href="/bluefontein2009.css" rel="stylesheet" type="text/css"><link href="p7pmm/p7PMMh10.css" rel="stylesheet" type="text/css" media="all"><style type="text/css">
.p7PMM div {position:absolute;display:none}
 
</style></head><body><br>
<b>Notice</b>:  Array to string conversion in <b>/home/fhlinux133/b/bluefonteinventures.com/user/htdocs/aboutus.php</b> on line <b>8</b><br>
 
 
 
 
 
 
 
<script type="text/javascript" src="p7pmm/p7PMMscripts.js"></script>
 
 
 
 
<div id="wrapper">
  <div class="masthead" id="homemast"><img src="/images/aboutmasthead.jpg" width="804" height="74" alt="bluefontein masthead"></div>
<div id="p7PMM_1" class="p7PMMh10" style="height: auto; ">
    <ul class="p7PMM level_1" id="p7PMM_1u1" style="position: static; margin-left: 0.5px; ">
      <li class="pmmfirst root_1"><a href="/index.php" class="p7PMM_img pmmfirst" id="p7PMM_1a1"><img src="/images/nav/home.jpg" width="160" height="25" alt="home"></a></li>
      <li class="root_2 li_current_mark"><a href="/aboutus.php" class="p7PMM_img current_mark" id="p7PMM_1a2"><img src="/images/nav/about_overdown.jpg" width="160" height="25" alt="about the company"></a></li>
      <li class="root_3"><a href="/ourservices.php" class="p7PMM_img" id="p7PMM_1a3"><img src="/images/nav/services.jpg" width="160" height="25" alt="our services"></a></li>
      <li class="root_4"><a href="/projects.php" class="p7PMM_img" id="p7PMM_1a4"><img src="/images/nav/projects.jpg" width="160" height="25" alt="project portfolio"></a></li>
      <li class="root_5 pmmlast"><a href="/contactus.php" class="p7PMM_img pmmlast" id="p7PMM_1a5"><img src="/images/nav/contact.jpg" width="160" height="25" alt="contact us"></a></li>
    </ul>
<div class="p7pmmclearfloat" id="p7PMM_1d2"> </div>
    <!--[if lte IE 6]>
<style>.p7PMMh10 ul ul li {float:left; clear: both; width: 100%;}.p7PMMh10 {text-align: left;}.p7PMMh10, .p7PMMh10 ul ul a {height: 1%;}</style>
<![endif]-->
    <!--[if IE 5.500]>
<style>.p7PMMh10 {position: relative; z-index: 9999999;}</style>
<![endif]-->
    <!--[if IE 7]>
<style>.p7PMMh10, .p7PMMh10 a{zoom:1;}.p7PMMh10 ul ul li{float:left;clear:both;width:100%;}</style>
<![endif]-->
    <script type="text/javascript">
<!--
P7_PMMop('p7PMM_1',1,2,-5,-5,0,1,0,1,2,3,1,1,0);
//-->
    </script>
  </div>
<div id="p7PMM_2" class="p7PMMh10" style="height: auto; ">
    <ul class="p7PMM level_1" id="p7PMM_2u1" style="position: static; margin-left: 0.5px; ">
      <li class="pmmfirst root_1"><a href="#" class="p7PMM_img pmmfirst" id="p7PMM_2a6"><img src="/images/nav/blank.jpg" width="160" height="25" alt=""></a></li>
      <li class="root_2"><a href="/aboutus.php?subPage_ID=1" class="p7PMM_img" id="p7PMM_2a7"><img src="/images/nav/company.jpg" width="160" height="25" alt="company background"></a></li>
      <li class="root_3"><a href="aboutus.php?subPages_id=3" class="p7PMM_img" id="p7PMM_2a8"><img src="/images/nav/mission.jpg" width="160" height="25" alt=""></a></li>
      <li class="root_4"><a href="/healthandsafety.php" class="p7PMM_img" id="p7PMM_2a9"><img src="/images/nav/healthandsafety.jpg" width="160" height="25" alt="health and safety policy"></a></li>
      <li class="root_5 pmmlast"><a href="/qualitypolicy.php" class="p7PMM_img pmmlast" id="p7PMM_2a10"><img src="/images/nav/quality.jpg" width="160" height="25" alt="quality policy"></a></li>
    </ul>
<div class="p7pmmclearfloat" id="p7PMM_2d2"> </div>
    <!--[if lte IE 6]>
<style>.p7PMMh10 ul ul li {float:left; clear: both; width: 100%;}.p7PMMh10 {text-align: left;}.p7PMMh10, .p7PMMh10 ul ul a {height: 1%;}</style>
<![endif]-->
    <!--[if IE 5.500]>
<style>.p7PMMh10 {position: relative; z-index: 9999999;}</style>
<![endif]-->
    <!--[if IE 7]>
<style>.p7PMMh10, .p7PMMh10 a{zoom:1;}.p7PMMh10 ul ul li{float:left;clear:both;width:100%;}</style>
<![endif]-->
    <script type="text/javascript">
<!--
P7_PMMop('p7PMM_2',1,2,-5,-5,0,1,0,1,2,3,1,1,0);
//-->
    </script>
  </div>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
    <tbody><tr>
      <td width="161"><img src="/images/aboutmainimage.jpg" width="161" height="250" alt="global reach"></td>
      <td width="639" valign="top"><p></p></td>
    </tr>
  </tbody></table>
  <table width="100%" border="0" cellpadding="0" cellspacing="1">
  <tbody><tr>
    <th width="275">The Team</th>
    <th width="275">Our Technical Partners</th>
    <th>Work With Us</th>
  </tr>
  <tr>
    <td width="275" valign="top" bgcolor="#CDAE84"><p>Mr Sokpiri Graham-Douglas - Managing Director</p>
    <p>Mr Olayinka Coker - General Manager</p></td>
    <td width="275" valign="top" bgcolor="#A4A3CB"><p>Bluefontein Ventures Ltd when necessary  enters in to partnership with some other companies<br>
      For most of its technical jobs. A few  examples are Fadicom International (Electrification/Electrical Engineering)  Hado Construction and Darycet International (Civil Engineering works) </p></td>
    <td valign="top"><p>If you are interested in a career at Bluefontein or would like to partner with us please fill in the form below and we will be in touch to discuss mutual benefits with you.</p>
      <form id="form1" name="form1" method="post" action="">
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
          <tbody><tr>
            <td align="left" valign="top"><label>Name</label></td>
            <td align="left" valign="top"><input type="text" name="txtName" id="txtName" tabindex="1"></td>
          </tr>
          <tr>
            <td align="left" valign="top"><label>Email</label></td>
            <td align="left" valign="top"><input type="text" name="txtEmail" id="txtEmail" tabindex="2"></td>
          </tr>
          <tr>
            <td align="left" valign="top"><label>Enquiry</label></td>
            <td align="left" valign="top"><textarea name="txtMessage" id="txtMessage" cols="25" rows="5" tabindex="3"></textarea></td>
          </tr>
          <tr>
            <td align="left" valign="top"> </td>
            <td align="left" valign="top"><input type="submit" name="Submit" id="Submit" value="Submit" tabindex="4"></td>
          </tr>
        </tbody></table>
      </form>
      <p> </p></td>
  </tr>
</tbody></table>
 
  <table width="100%" border="0" cellpadding="0" cellspacing="0" id="footer">
  <tbody><tr>
    <td bgcolor="#005245">Terms of Use | Privacy Statement | Contact Us | Site Credits</td>
  </tr>
</tbody></table>
</div>
 
 
</body></html>

Open in new window

0
Jason C. LevineNo oneCommented:
cokefour,

This recordset depends on data being present in the query string:

$colname_rsSubPages = "1";
if (isset($_GET['subPages_id'])) {
  $colname_rsSubPages = $_GET['subPages_id'];
}
mysql_select_db($database_connBlue, $connBlue);
$query_rsSubPages = sprintf("SELECT * FROM subPages WHERE subPages_id = %s", GetSQLValueString($colname_rsSubPages, "int"));

So when you preview, you need "somepage.php?subPages_id=X" in the url or the database must have a matching value for subPages_id = 1

What you can also try is adding some Show Region behaviors into the page.  Create the following HTML code:

<p>Dreamweaver found data</p>
<p>Dreamweaver did not find data</p>

Highlight the first paragraph and apply "Show Region if Recordset is not empty"  
Highlight the second paragraph and apply "Show Region if Recordset is empty"

Browse to the page again.  If the second paragraph shows up, we know the query is not pulling the data.
0
cokefourAuthor Commented:
found data shows up but doesn't display anything
0
Jason C. LevineNo oneCommented:
Can you give me a link to test live?  Also, are you sure your column names are accurate?
0
cokefourAuthor Commented:
the column names are accurate, is it OK to use underscore etc?
http://www.bluefonteinventures.com/aboutus.php?subPages_id=1
0
Jason C. LevineNo oneCommented:
It should be fine to use an underscore in both the column and PHP variable names but that may the issue.   Try renaming the MySQL columns to remove the underscore...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cokefourAuthor Commented:
Don't you just love it when the answer is staring you in the face and it doesn't throw an error. Thanks. It wouldn't work until I'd removed the underscores from all the column headings in the table
0
Jason C. LevineNo oneCommented:
Hell, you should have accepted your own post as the answer...you suggested it :)

The weird thing is that we use underscores in MySQL and don't have this problem...what version are you using?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.