Albee_J
asked on
PHP query into multiple column table
I have a db table that stores statistics for page view on our techcells.
"select statDate, views from techcellStats WHERE techcellID = '$techcellID' ";
I need to spit that data out into an html table that shows horizontally
column headings: Jan. Feb. Mar. April
Views views views views
"select statDate, views from techcellStats WHERE techcellID = '$techcellID' ";
I need to spit that data out into an html table that shows horizontally
column headings: Jan. Feb. Mar. April
Views views views views
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Table is displaying but I cannot get techcellID to pass into the query correctly... I am using a drop down list to select what to view
function display_db_table($tablenam e, $connection,
$header_bool, $table_params)
{
$query_string = "SELECT * FROM techcellView WHERE techcellID = '$techcellID' ";
display_db_query($query_st ring, $connection,
$header_bool, $table_params);
}
?>
function display_db_table($tablenam
$header_bool, $table_params)
{
$query_string = "SELECT * FROM techcellView WHERE techcellID = '$techcellID' ";
display_db_query($query_st
$header_bool, $table_params);
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
According to the function you posted, you didn't assigned a value to $techcellID, therefore it's undefined.
You need to assign a value to $techcellID, so SQL will query about it, here is example:
You need to assign a value to $techcellID, so SQL will query about it, here is example:
function display_db_table($tablename, $connection, $header_bool, $table_params)
{
$techcellID = 1; // Now $techcellID is defined
$query_string = "SELECT * FROM techcellView WHERE techcellID = $techcellID";
display_db_query($query_string, $connection,
$header_bool, $table_params);
}
ASKER
Got it thanks! I had to slightly modify
$techcellID = $_GET['techcells'];
$techcellID = $_GET['techcells'];
You are welcome! :)
ASKER
Do you have any idea how I could make the Stat Dats display horizontally with the views underneath?
This is how it looks now.
techcells.jpg
This is how it looks now.
techcells.jpg
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great thanks!
ASKER