Here's the problem that I'm having- I'm trying to pull in 2 fields from my database and place them in the title of the HTML. I'm connecting to the db and selecting everything exactly the same as I am doing below, and it works fine. For some reason it's not pulling in the fields. Any ideas?
Here's the link to the actual page I'm working on. http://www.roomfulexpress.com/newsit...Y_CD=558167959
Please see below for my code. Thanks! - <!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=iso-8859-1" />
-
-
<?php
-
-
// Get the search variable from URL
-
-
$var = @$_GET['FAMILY_CD'] ;
-
$trimmed =($var); //trim whitespace from the stored variable
-
-
//connect to DB
-
mysql_connect("xxx","xxx","xxx"); //(host, username, password)
-
-
//specify database
-
mysql_select_db("xxx") or die("Unable to select database");
-
-
// Build SQL Query
-
$query = "select * from tblFamily where FAMILY_CD like \"%$trimmed%\" order by FAMILY_NAME desc"; // this will only effect the data pulling from the family table
-
-
$result = mysql_query($query) or die("Couldn't execute query"); // grab results
-
-
while ($row = mysql_fetch_array($result)) // show results
-
-
?>
-
-
<?php echo("<title>" . $row["FAMILY_NAME"] . " - ". $row["CATEGORY"] . " Furniture Package" . "</title>"); ?>
-
-
<link href="../css/profile.css" rel="stylesheet" type="text/css" />
-
<link href="../css/slimbox.css" rel="stylesheet" type="text/css" />
-
<script type="text/javascript" src="../js/mootools.v1.11.js"></script>
-
<script type="text/javascript" src="../js/slimbox.js"></script>
-
<script type="text/javascript">
-
-
function popUp(URL) {
-
day = new Date();
-
id = day.getTime();
-
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=520,height=600,left = 300,top = 100');");
-
}
-
</script>
-
-
</head>
-
-
<body>
-
<div class="container">
-
-
<?php
-
-
// Get the search variable from URL
-
-
$var = @$_GET['FAMILY_CD'] ;
-
$trimmed =($var); //trim whitespace from the stored variable
-
-
//connect to DB
-
mysql_connect("sql002.choiceone.net","roomfulexpress","x47rkv7N"); //(host, username, password)
-
-
//specify database
-
mysql_select_db("roomfulexpress") or die("Unable to select database");
-
-
// Build SQL Query
-
$query = "select * from tblFamily where FAMILY_CD like \"%$trimmed%\" order by FAMILY_NAME desc"; // this will only effect the data pulling from the family table
-
-
$result = mysql_query($query) or die("Couldn't execute query"); // grab results
-
-
while ($row = mysql_fetch_array($result)) // show results
-
{
-
echo("<img src=../images/top.jpg />");
-
echo("<table width=650px cellpadding=2px cellspacing=1px bgcolor=#F3F1EB>");
-
echo("<tr class=lightBG>");
-
echo("<td class=lightBG><h1> ". $row["FAMILY_NAME"] . " - ". $row["CATEGORY"] . " Furniture Package" . "</h1> ". $row["ROOMFUL_CONTAINS"] . " <br/><br/><ul> " . $row["FAMILY_DESC"] . $row["FAMILY_DESC_2"] . $row["FAMILY_DESC_3"] . $row["FAMILY_DESC_4"] . $row["FAMILY_DESC_5"]. $row["FAMILY_DESC_6"] . $row["FAMILY_DESC_7"] . " </ul> </td>");
-
echo("<TD class=photoBorder width=300px><a href=". $row["FL"] . " rel=lightbox> <img src=" . $row["PR"] . " /><br /><span class=smallFont>+ click to enlarge</a></span><br/><div class=smallerFontLeft><A HREF=javascript:window.print()> <img src=../images/common/print.jpg align=bottom /> click to print this profile</A></div></TD>");
-
echo("</tr>");
-
}
-
echo("</table>");
-
-
-
// Build SQL Query
-
$query2 = "select * from tblItem where FAMILY_CD like \"%$trimmed%\" order by ITEM_NAME desc"; // this will only effect the data pulling from the Item table
-
$result2 = mysql_query($query2) or die("Couldn't execute query"); // grab results
-
-
-
{
-
-
echo("<tr><img src=../images/savepiece.jpg /></tr>");
-
echo("<table width=650px cellspacing=1px cellpadding=2px border=1px solid #666666>");
-
echo("<tr class=backgroundColorTR>");
-
echo("<td width=250px><b>Item Name</b></td>");
-
echo("<td width=133px><b>Product ID #</b></td>");
-
echo("<td width=133px><b>Size</b></td>");
-
echo("<td width=133px><b>Sale Price</b></td>");
-
echo("</tr>");
-
}
-
-
-
while ($row = mysql_fetch_array($result2)) // show results
-
-
{
-
echo("<tr class=lightBG>");
-
echo("<td> ". $row["ITEM_NAME"] .$row["DISCLAIMER"] . " </td>");
-
echo("<td><!--<a href=itemprofile.php?SKU=". $row["SKU"] . "--> " . $row["SKU"] . "<!--</a>--></td>");
-
echo("<td> ". $row["SIZE"] . "</td>");
-
-
echo("<td> ". $row["ITEM_RETAIL_PRICE"] . "</td>");
-
echo("</tr>");
-
}
-
echo("</table>");
-
// Build SQL Query
-
$query3 = "select * from tblPackage where FAMILY_CD like \"%$trimmed%\" order by PACKAGE_DESC"; // this will only effect the data pulling from the Package table
-
-
$result3 = mysql_query($query3) or die("Couldn't execute query"); // grab results
-
{
-
echo("<img src=../images/saveroomful.jpg />");
-
echo("<table width=650px cellspacing=1px cellpadding=2px border=1px solid #666666>");
-
echo("<tr class=backgroundColorTR>");
-
echo("<td width=150px><b>Roomful Package</b></td>");
-
echo("<td width=100px><b>Roomful ID #</b></td>");
-
echo("<td width=350px><b>Roomful Contains</b></td>");
-
echo("<td width=130px><b>Roomful Savings</b></td>");
-
echo("<td width=120px><b>Sale Price</b></td>");
-
echo("</tr>");
-
}
-
while ($row = mysql_fetch_array($result3)) // show results
-
-
{
-
-
echo("<tr class=lightBG>");
-
echo("<td> ". $row["PACKAGE_DESC"] . "</td>");
-
echo("<td> ". $row["PKG_ITM_CD"] . "</td>");
-
echo("<td> ". $row["PACKAGE_CONTENTS"] . "</td>");
-
echo("<td> ". $row["PACKAGE_SAVE"] . "</td>");
-
echo("<td> ". $row["PACKAGE_RETAIL_PRICE"] . "</td>");
-
echo("</tr>");
-
}
-
echo("</table>");
-
-
-
-
?>
-
<div class="disclaimer">* Tables and lamps may not be as shown in photo. Please see store for additional details.</div>
-
</div>
-
</body>
-
</html>
6 2274
What line specifically are you talking about. and are you trying to post the db stuff at the top of the page title or the actual page title up where it is "-furniture package - windows explorer"?
Im assuming you mean the latter.Which is line 28.
laz
Ok i figured out your problem on my test pages. It seems you have to move your line 28: -
<?php echo("<title>" . $row["FAMILY_NAME"] . " - ". $row["CATEGORY"] . " Furniture Package" . "</title>"); ?>
-
to a spot after your Get var for the page info that you want to insert for example if you are getting the var in your db for item x to display more detailed page on item x then your line 28 has to be after the get var for that item or you'll have to tell the page exactly what to get. but im assuming its set up like my test db page is so just move line 28 to the bottom of the page and you should be good to go.
Just tried moving line 28 to the bottom of the page... didn't work. I put it totally at the bottom, below the </body> and </html>...
It's passing thru as blank.
What it should say for the title of the page (in the <title></title> tags) is
'Alexia Bronze - Living Room Furniture Package'
Any other thoughts?
Yeah im tapping out. What you need to do is specify to the code where to gather the info for your line 28. Are you pulling this "Alexia Bronze - Living Room Furniture" from a previous link or you just make this one page as a test page? or you just building this page?
basically your coding is correct though, just the page has no idea where to gather the info for your title.
laz
I see you got it working. I hope i helped at all.
Grats.
Laz
Just figured it out. Since I'm performing queries to multiple tables, it has to go right before I move to my next table. Also, it requires another db query before I build the html table with the other fields...
[PHP]// Build SQL Query
$query = "select * from tblFamily where FAMILY_CD like \"%$trimmed%\" order by FAMILY_NAME desc"; // this will only effect the data pulling from the family table
$result = mysql_query($query) or die("Couldn't execute query"); // grab results
while ($row = mysql_fetch_array($result)) // show results[/PHP]
Thanks for the ideas!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: dave |
last post by:
I am trying to generate an email from the webpage using code below, which
works fine. However I want to be able to include some dyanmic data how do I
go about it ?can anybody point me in the...
|
by: ergobob |
last post by:
Hello,
I have two small PHP scripts running on a test page at:
http://www.usernomics.com/ergonomic-products-accessories5.html
Both scripts work perfectly when there is one script on a page....
|
by: Goober |
last post by:
I have the following default.aspx page that works properly.
However, what I want to do is to link the graphics within it (that are hard
coded now in the default web page) to our corporate...
|
by: 35th Ave Media |
last post by:
Hello,
I have about 60+ pages that I need to insert a MAILTO: tag so people can
email the page using their email client. The body of the message is
going to be the URL of that page. Using ASP,...
|
by: JMann101 |
last post by:
I am writing a ASP.NET(VB) application and am having some trouble. I
have a datagrid which list users and when an admin clicks "edit" a
defined column becomes visible and a dynamic listbox control...
|
by: Abraham Luna |
last post by:
how do i stop the dynamic validators from breaking explorer
if i use a dynamic validator and move to a different control it breaks
explorer and i can type in the page when i'm not supposed to....
|
by: WolfyUK |
last post by:
Hello,
I have a standard asp:DataGrid called CasesGrid that I wish to write my
own paging controls for. The aim is to get something like the following
rendered to screen:
<< First < Previous...
|
by: karen987 |
last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
|
by: bmallett |
last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |