Jiggens
asked on
PHP coding
PHP Question?
How could i update this file to have a if statement for just a specific siteplan ID to dislpay Building instead of Model?
$query = "SELECT * from psh_siteplans WHERE communityID = '$ID' ORDER BY orderID";
$result = mysql_query($query);
while ($row = mysql_fetch_row($result)) {
print "<form action=" . $_SERVER['PHP_SELF'] . "?ID=" . $ID . "&siteID=" . $row[0] . " method='POST'>";
print "<table border='0' cellspacing='0' cellpadding='5'><tr>";
$window = "'http://homes.pacificscene.com/popup.php?type=renderings&ID=" . $row[0] . "','popUp','width=775,heig ht=550'";
print "<td width='206' rowspan='8' valign='top'>";
print '<a href="javascript:;"><img border="0" src="http://homes.pacificscene.com/images/browse/renderings/' . $row[0] . '-TH.jpg" onclick="MM_openBrWindow(' . $window . ')" /></a>';
print "</td>";
print "<td width='135'><strong>Model< /strong></ td>";
print "<td>" . $row[1] . "</td></tr>";
print "<tr><td><strong>Appx Sq. Ft</strong>.</td>";
print "<td>" . $row[2] . "</td></tr>";
print "<tr><td><strong>Stories</ strong>.</ td>";
print "<td>" . $row[3] . "</td></tr>";
print "<tr><td><strong>Bedrooms< /strong>.< /td>";
print "<td>" . $row[4] . "</td></tr>";
print "<tr><td><strong>Baths</st rong>.</td >";
print "<td>" . $row[5] . "</td></tr>";
print "<tr><td><strong>Garage</s trong>.</t d>";
print "<td>" . $row[6] . "</td></tr>";
$window = "'http://homes.pacificscene.com/popup.php?type=floorplans&ID=" . $row[0] . "','popUp','width=825,heig ht=625,scr ollbars=ye s'";
http://homes.pacificscene.com/browse/community.php?ID=43
I have multiple communities and i need to be able to have this one display Building instead of Model
How could i update this file to have a if statement for just a specific siteplan ID to dislpay Building instead of Model?
$query = "SELECT * from psh_siteplans WHERE communityID = '$ID' ORDER BY orderID";
$result = mysql_query($query);
while ($row = mysql_fetch_row($result)) {
print "<form action=" . $_SERVER['PHP_SELF'] . "?ID=" . $ID . "&siteID=" . $row[0] . " method='POST'>";
print "<table border='0' cellspacing='0' cellpadding='5'><tr>";
$window = "'http://homes.pacificscene.com/popup.php?type=renderings&ID=" . $row[0] . "','popUp','width=775,heig
print "<td width='206' rowspan='8' valign='top'>";
print '<a href="javascript:;"><img border="0" src="http://homes.pacificscene.com/images/browse/renderings/' . $row[0] . '-TH.jpg" onclick="MM_openBrWindow('
print "</td>";
print "<td width='135'><strong>Model<
print "<td>" . $row[1] . "</td></tr>";
print "<tr><td><strong>Appx Sq. Ft</strong>.</td>";
print "<td>" . $row[2] . "</td></tr>";
print "<tr><td><strong>Stories</
print "<td>" . $row[3] . "</td></tr>";
print "<tr><td><strong>Bedrooms<
print "<td>" . $row[4] . "</td></tr>";
print "<tr><td><strong>Baths</st
print "<td>" . $row[5] . "</td></tr>";
print "<tr><td><strong>Garage</s
print "<td>" . $row[6] . "</td></tr>";
$window = "'http://homes.pacificscene.com/popup.php?type=floorplans&ID=" . $row[0] . "','popUp','width=825,heig
http://homes.pacificscene.com/browse/community.php?ID=43
I have multiple communities and i need to be able to have this one display Building instead of Model
Not quite sure I understand your question fully.
From the code you pasted it's hard to guess what's Building and what Model...using mysql_fetch_assoc would be better.
You will need to change this:
print "<td width='135'><strong>Model< /strong></ td>";
print "<td>" . $row[1] . "</td></tr>";
into:
$specificID = '5';
if($row[0] == $specificID) {
print "<td width='135'><strong>Buildi ng</strong ></td>";
print "<td>" . $row[xyz] . "</td></tr>";
}
else {
print "<td width='135'><strong>Model< /strong></ td>";
print "<td>" . $row[1] . "</td></tr>";
}
Where xyz is appropriate column number that contains Building info, and $specificID is the ID of which you want to print Building info.
You will need to change this:
print "<td width='135'><strong>Model<
print "<td>" . $row[1] . "</td></tr>";
into:
$specificID = '5';
if($row[0] == $specificID) {
print "<td width='135'><strong>Buildi
print "<td>" . $row[xyz] . "</td></tr>";
}
else {
print "<td width='135'><strong>Model<
print "<td>" . $row[1] . "</td></tr>";
}
Where xyz is appropriate column number that contains Building info, and $specificID is the ID of which you want to print Building info.
ASKER
Frin,
I don't exactly know what $[xyz] is because i dont have that data in my DB show i put it there?
I don't exactly know what $[xyz] is because i dont have that data in my DB show i put it there?
ASKER
all i want to do is change the tags the info will be the same as the Model i just want to change the TAG to read Building and not Model
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
that still didnt work