/    Sign up×
Community /Pin to ProfileBookmark

Connection Problems?

Here is my delimma the webpage should pull all of the information from the database and it does not show anything on the page. Not even the employee’s name. Also dreamweaver doesnt recognize it its really annoying sheesh if anyone can help i will be happy(yes i know the connection is commented out)

[code=php]<?php
//Connection statement
//require_once(‘../../Connections/befh.php’);

// begin Recordset
$colname__rs_employeeDetail = ‘1’;
if (isset($HTTP_GET_VARS[’employeeID’])) {
$colname__rs_employeeDetail = $HTTP_GET_VARS[’employeeID’];
}
$query_rs_employeeDetail = sprintf(“SELECT staffquestions.staffquestion, staffanswers.staffanswer FROM staffquestions, staffanswers WHERE staffanswers.employeeID = %s AND staffanswers.staffquestionID = staffquestions.staffquestionID”, $colname__rs_employeeDetail);
$rs_employeeDetail = $befh->SelectLimit($query_rs_employeeDetail) or die($befh->ErrorMsg());
$totalRows_rs_employeeDetail = $rs_employeeDetail->RecordCount();
// end Recordset

// begin Recordset
$colname__rs_employeePhoto = ‘-1′;
if (isset($HTTP_GET_VARS[’employeeID’])) {
$colname__rs_employeePhoto = $HTTP_GET_VARS[’employeeID’];
}
$query_rs_employeePhoto = sprintf(“SELECT * FROM employees WHERE employeeID = %s”, $colname__rs_employeePhoto);
$rs_employeePhoto = $befh->SelectLimit($query_rs_employeePhoto) or die($befh->ErrorMsg());
$totalRows_rs_employeePhoto = $rs_employeePhoto->RecordCount();
// end Recordset

$SSAdv_colors1 = array(“RowOdd”,”RowEven”);
$SSAdv_k1 = 0;
$SSAdv_m1 = 0;
$SSAdv_change_every1 = 1;

//PHP ADODB document – made with PHAkt 2.7.1
?>[/code]

to post a comment
PHP

10 Comments(s)

Copy linkTweet thisAlerts:
@sitehatcheryAug 31.2006 — Hey there, I have a couple thoughts:

1. What does your connection string look like?

2. Are you running the page on your local host? Do you have PHP installed?

3. You say that noting is showing at all. If you are uploading to a remote server, do they have errors disabled? If they are and you have an error, it will just show a blank screen for the most part.

4. I'm not seeing here where you are writing anything to monitor in this code. Can you show that code?
Copy linkTweet thisAlerts:
@Codeman0013authorAug 31.2006 — Here is the entire page:

[code=php]<?php
//Connection statement
//require_once('../../Connections/befh.php');

// begin Recordset
$colname__rs_employeeDetail = '1';
if (isset($HTTP_GET_VARS['employeeID'])) {
$colname__rs_employeeDetail = $HTTP_GET_VARS['employeeID'];
}
$query_rs_employeeDetail = sprintf("SELECT staffquestions.staffquestion, staffanswers.staffanswer FROM staffquestions, staffanswers WHERE staffanswers.employeeID = %s AND staffanswers.staffquestionID = staffquestions.staffquestionID", $colname__rs_employeeDetail);
$rs_employeeDetail = $befh->SelectLimit($query_rs_employeeDetail) or die($befh->ErrorMsg());
$totalRows_rs_employeeDetail = $rs_employeeDetail->RecordCount();
// end Recordset

// begin Recordset
$colname__rs_employeePhoto = '-1';
if (isset($HTTP_GET_VARS['employeeID'])) {
$colname__rs_employeePhoto = $HTTP_GET_VARS['employeeID'];
}
$query_rs_employeePhoto = sprintf("SELECT * FROM employees WHERE employeeID = %s", $colname__rs_employeePhoto);
$rs_employeePhoto = $befh->SelectLimit($query_rs_employeePhoto) or die($befh->ErrorMsg());
$totalRows_rs_employeePhoto = $rs_employeePhoto->RecordCount();
// end Recordset

$SSAdv_colors1 = array("RowOdd","RowEven");
$SSAdv_k1 = 0;
$SSAdv_m1 = 0;
$SSAdv_change_every1 = 1;


//PHP ADODB document - made with PHAkt 2.7.1
?>
<!-- body content -->

<table width="100%" border="0" cellspacing="30" cellpadding="0">
<tr>
<td width="20%" valign="top" align="right"><table width="130" cellspacing="5" cellpadding="1" class="subnavigation">
<tr>
<td align="right" valign="top"><a href="about.php" class="sub">About Us Home</a><br><a href="about_history.php" class="sub">Extended History</a><br><img src="images/arrow.gif"><a href="about_staff.php" class="subSelect">Staff</a><br><a href="about_affiliations.php" class="sub">Affiliations</a>
</td>
</tr>
</table></td>
<td align="left"><!-- <p><b><a href="about_staff.php">Staff</a> > Getting to know... </b></p> -->
<p><table width="500" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" width="100"><img src="images/staff/<?php echo $rs_employeePhoto->Fields('employeePhoto'); ?>" alt="" hspace="10" vspace="5" border="1" align="left"></td>
<td valign="middle"><p><b><?php echo $rs_employeePhoto->Fields('employeeName'); ?></b><br><?php echo $rs_employeePhoto->Fields('employeeTitle'); ?></p></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>


<table width="500" bgcolor="#FFFFFF" border="0" cellspacing="" cellpadding="6">
<?php if ($totalRows_rs_employeePhoto > 0) { // Show if recordset not empty ?>
<?php
while (!$rs_employeeDetail->EOF) {
?>

<tr class="

<?php
if($SSAdv_m1%$SSAdv_change_every1==0 && $SSAdv_m1>0){
$SSAdv_k1++;
}
print $SSAdv_colors1[$SSAdv_k1%count($SSAdv_colors1)];
$SSAdv_m1++;
?>">
<td valign="top" width="175"><p><b><?php echo $rs_employeeDetail->Fields('staffquestion'); ?></b></p></td>
<td valign="top"><p><?php echo $rs_employeeDetail->Fields('staffanswer'); ?></p></td>
</tr>


<?php
$rs_employeeDetail->MoveNext();
}
?>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_rs_employeeDetail == 0) { // Show if recordset empty ?>
<tr><td colspan="2">
<p>Information on <?php echo $rs_employeePhoto->Fields('employeeName'); ?> is not available at this time.<br> Please check back shortly.</p>
</td></tr><?php } // Show if recordset empty ?>
</table>
<p>&nbsp;</p>
</td>
</tr>
</table>
<!-- end of body content -->
<?php
$rs_employeeDetail->Close();

$rs_employeePhoto->Close();
?>[/code]
Copy linkTweet thisAlerts:
@sitehatcheryAug 31.2006 — I'd be more than happy to try and help you. First though, have you answered for yourself any of the questions I asked? This post seems to only address the last question.

One thing I noticed, you haven't constructed an object in the above code, but you are making references to objects. Is this an included file?
Copy linkTweet thisAlerts:
@Codeman0013authorAug 31.2006 — Sorry yes it is an include i took this over for a user it works on the actual website but not locally thats our issue locally we have a newer version of php so i'm wondering what i need to change to make it work so this will work locally as well and then upload it to the server to update their stuff too error reporting is on and it appears its not connecting to the databse. i put a trace in and i get

Notice: Undefined variable: database_table in /u/internet/com/brintlinger-earl/includes/content/about_staff_detail.php on line 32

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /u/internet/com/brintlinger-earl/includes/content/about_staff_detail.php on line 36

No entries match criteria

Maybe that helps you?
Copy linkTweet thisAlerts:
@sitehatcheryAug 31.2006 — go to about_staff_detail.php on line 32. Show me how this area reads. Also, show me where you are defining 'database_table'.
Copy linkTweet thisAlerts:
@Codeman0013authorAug 31.2006 — line 32 simply says <!-- end of main table --> here is the whole page [code=php] <?php //PHP ADODB document - made with PHAkt 2.6.5
//Connection statement
require_once('Connections/befh.php');
?>

<html>
<head>
<title>Brintlinger and Earl Funeral Homes. 120 Years of Service from the Heart.</title>
<link href="befh.css" rel="stylesheet" type="text/css">
</head>

<body>
<!-- 100% table -->
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top">


<!-- Main Table w/repeating background border -->
<table width="750" height="100%" border="0" cellspacing="0" cellpadding="0" background="images/back_main.gif">
<tr>
<td width="750">
<?php include("includes/global/header.inc"); ?>
<?php include("includes/photo_headers/about.inc"); ?>
<?php include("includes/global/nav_secondary.inc"); ?>
<?php include("includes/sub_headers/about.inc"); ?>
<?php include("includes/content/about_staff_detail.php"); ?>
<?php include("includes/global/footer.inc"); ?>
</td>
</tr>
</table>
<!-- end of main table -->


</td>
</tr>
</table>
<!-- end of 100% table -->
</body>
</html>

[/code]


what do you mean defining the database_table??
Copy linkTweet thisAlerts:
@sitehatcheryAug 31.2006 — Do a sitewide search for database_table. Your error said the your are trying to use an undefined variable 'database_table' in the file called "about_staff_detail.php" on line 32.

My guess is that you meant to put $database_table, but you missed the dollar sign somewhere and it's figuring that you are trying to use a constant that is not defined.

Is this file called about_staff_detail.php and is it in the directory "/u/internet/com/brintlinger-earl/includes/content/"?
Copy linkTweet thisAlerts:
@Codeman0013authorAug 31.2006 — Ok i figured out one thing was that database_table should have said like a name of one of the tables in the database which i changed and it found data but it does not want to display it on the page. To answer your question yes it is in the folder. I'm kinda lost on what else to do its just strange it works with one server but not the one with the newer php on it this page was made by the former intern and i think something is missing probably a bracket or something i dont know...
Copy linkTweet thisAlerts:
@Codeman0013authorSep 01.2006 — did they drastically change it? I cannot get my dreamweaver to connect to the database to have it built the query so i'm totally lost and i dont know if i will ever get it working on our local site
Copy linkTweet thisAlerts:
@Codeman0013authorSep 01.2006 — Ok here is my thing i have done some error testing and found it has somethign to do with how the information is being taken from the url if i set a default value it works fine but if i dont then it shows up blank can anyone trouble shoot the following code and see if i'm pulling from the url wrong?

[code=php]// begin Recordset
$colname__rs_employeeinfo = '1';
if (isset($HTTP_GET_VARS['employeeID'])) {
$colname__rs_employeeinfo = $HTTP_GET_VARS['employeeID'];
}
$query_rs_employeeinfo = sprintf("SELECT * FROM employees WHERE employeeID = %s", GetSQLValueString($colname__rs_employeeinfo, "int"));
$rs_employeeinfo = $befh->SelectLimit($query_rs_employeeinfo) or die($befh->ErrorMsg());
$totalRows_rs_employeeinfo = $rs_employeeinfo->RecordCount();
// end Recordset

// begin Recordset
$colname__rs_employeeqa = '-1';
if (isset($HTTP_GET_VARS['employeeID'])) {
$colname__rs_employeeqa = $HTTP_GET_VARS['employeeID'];
}
$query_rs_employeeqa = sprintf("SELECT * FROM staffanswers, staffquestions WHERE staffanswers.employeeID = %s AND staffanswers.staffquestionID = staffquestions.staffquestionID", GetSQLValueString($colname__rs_employeeqa, "int"));
$rs_employeeqa = $befh->SelectLimit($query_rs_employeeqa) or die($befh->ErrorMsg());
$totalRows_rs_employeeqa = $rs_employeeqa->RecordCount();
// end Recordset[/code]
×

Success!

Help @Codeman0013 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...