Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-31-2006, 09:17 PM   PM User | #1
Codeman0013
New Coder

 
Join Date: Aug 2006
Location: Decatur Illinois
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Codeman0013 has a little shameless behaviour in the past
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)

PHP Code:
<?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
?>
Codeman0013 is offline   Reply With Quote
Old 08-31-2006, 10:13 PM   PM User | #2
dsavage666
New Coder

 
Join Date: Aug 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
dsavage666 is an unknown quantity at this point
Simplify..

Hey, scale back your code (or make a new script) that *JUST* connects to the DB or errors out...that way you'll know if you're chasing a connection error or a code problem:

Code:
// add connection code

$select = "select * from $database_table";

$sqlresults = mysql_query($select);

$row_count = mysql_num_rows($sqlresults);
if ($row_count = = "0")
{
echo "No entries match criteria";
}
dsavage666 is offline   Reply With Quote
Old 08-31-2006, 10:17 PM   PM User | #3
Codeman0013
New Coder

 
Join Date: Aug 2006
Location: Decatur Illinois
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Codeman0013 has a little shameless behaviour in the past
It now says

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


WHat does that mean?
Codeman0013 is offline   Reply With Quote
Old 08-31-2006, 10:28 PM   PM User | #4
GJay
Senior Coder

 
Join Date: Sep 2005
Posts: 1,791
Thanks: 5
Thanked 36 Times in 35 Posts
GJay is on a distinguished road
it means you need to assign something sensibe to the variable $database_table, i.e. the name of one of your database tables
GJay is offline   Reply With Quote
Old 08-31-2006, 10:28 PM   PM User | #5
dsavage666
New Coder

 
Join Date: Aug 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
dsavage666 is an unknown quantity at this point
Uh...

I'd start by setting the $database_table variable equal to whatever your table is named in the database...

That should kill both errors with one definition.
dsavage666 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:25 AM.


Advertisement
Log in to turn off these ads.