Forum Moderators: coopster

Message Too Old, No Replies

Assigning variables to collumn with multiple values

Assigning variables to collumn with multiple values

         

brimike007

12:55 pm on Feb 5, 2010 (gmt 0)

10+ Year Member



Hi,
I am pretty new to this so here it goes.
I have a column with multiple values in each field.
apples
||
A
||
B
||
C
I am trying to assign a different variable to each
Letter and echo the results. What do you think the best way to do this is? An array, else if ?

Thanks

rocknbil

7:15 pm on Feb 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard brimike007,

I have a column with multiple values in each field.


What kind of column, database column or just flat table data? It kind of matters.

$vals = Array (
'A' => 'A value',
'B' => 'B value',
'C' => 'C value'
);

$out = '<table><tr>';
for each ($vals as $key=>$value) {
$out .= '<td>' . $key . ':' . $value . '</td>';
}
$out .= '</tr></table>';
echo $out;

brimike007

8:02 pm on Feb 5, 2010 (gmt 0)

10+ Year Member



Hi rocknbil,

It's a MySQL db, I am able to pull data, but want to assign a variable to the letters in that field.

Thanks
I'll try what you sent

brimike007

9:21 pm on Feb 5, 2010 (gmt 0)

10+ Year Member



Basically I am displaying a field like
<?php echo $row_Recordset1['REMARKS']; ?>
and the Column remarks has a differnet letter value in each field, I want to assign a new value to the letters in each field and repeat the region.

Thanks

brimike007

1:55 pm on Feb 6, 2010 (gmt 0)

10+ Year Member



Hello rocknbil,

Heres what I cam eup with but it is echoing all values in each field instead of the single value tha's in the field. Any ideas?

<?php
$row_Recordset1['STATUS_CODE'] = Array (
'A' => 'Active',
'P' => 'ue',
'S' => '78',
'W' => 'B lue',
'E' => 'B00ue',
);
$out = '<table><tr>';
foreach( $row_Recordset1['STATUS_CODE'] as $key => $value) {
$out .= '<td>' . $value . '</td>';
}
$out .= '</tr></table>';
echo $out;
?>

rocknbil

9:03 pm on Feb 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I still didn't get what you meant, but the last post is warming it up . . . I am going with two "possible assumptions." The first is that you are accessing just db fields, and might be doing so incorrectly. Example:

id|title|whatever
1|test|this is a test

$query = "select * from table";
$result = mysql_query($result);
while ($row=mysql_fetchrow_array($result)) {
echo $row['id'] . " " . $row['title'] . " " . $row['whatever'] . "<br>\n";
}

Note that the field names are used to access the array $row, which can be either an associative array or an indexed array. You will get the exact same results with this:

ARGH. Can't show you this due to recent updates on this board that cause this to BREAK. Where you see THIS
[
0
]
These go all on one line.


echo $row
[
0
]
. " " . $row
[
1
] . " " . $row
[
2
] . "<br>\n";

If that's the issue, great. Otherwise, the previous . . .

the Column remarks has a different letter value in each field


leads me to think, you have a delimited string in a single database field, something like

($row['whatever'])

foo|fee|fi|fo|fum

or

foo,fee,fi,fo,fum

Is that correct? Before I go further, note that this is **always** a bad idea for various reasons, the primary one being is makes the easy search tools of mySQL very complicated. Second, it's seldom an efficient way to store the data in question. These should be stores in individual fields, so put that in your toolbox and maybe re-think it.

If the above is true, here is likely what your solution is. I don't know exactly what your delimiter is, so swap | for whatever that is.

Note also, I don't know how many "fields" are in your database field, so I've implemented a loop to go through them. Hopefully not more than 26. :-)


<?php
// an array of the KEYS
$keys = Array('A','B','C','D','E','F','G','H','I','J','K',
'L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
//
$delim_data=$out=NULL;
$query = "select some-field from table";
$result = mysql_query($result);
// Only one field - index 0 does fine, but this board BREAKS it
while ($row=mysql_fetchrow_array($result)) {
$delim_data = explode('|',$row['whatever']);
for ($i=0;$i<count($delim_data);$i++) {
$keys[$i] = $delim_data[$i];
}
}
if ($delim_data) {
$out = '<table><tr>';
foreach ($delim_data as $key => $value) {
$out .= "<td> Key: $key Value: $value </td>";
}
$out .= '</tr></table>';
}
else { $out = '<p>No records to display</p>'; }
echo $out;
?>



The reason I'm confused is you mentioned a field that contains fields, and used 'REMARKS' in your first example, 'STATUS_CODE' in your second. So is one onf these even close?

brimike007

9:56 pm on Feb 6, 2010 (gmt 0)

10+ Year Member



Sorry about the confusion it's just a column, in each field in that column there is a value like A,B,C etc.
What I need to do is just give those letters a variable and print that one value.
Thanks for your help,
I'll review what you sent and see if I can make heads or tails

brimike007

10:32 pm on Feb 6, 2010 (gmt 0)

10+ Year Member



by the way in this particlular column there is only one value, in another column I need to contend with there is more than one value.

brimike007

10:08 pm on Feb 7, 2010 (gmt 0)

10+ Year Member



I guess I am getting confused. I am trying the code and running into errors mainly
Fatal error: Call to undefined function mysql_fetchrow_array()


<td><?php echo $row_Recordset1['PROPERTY_TYPE_CODE']; ?>  </td>
<td><?php echo $row_Recordset1['PROP_TYPE_DESCRIPTION']; ?>  </td>
<td><?php echo $row_Recordset1['REMARKS']; ?>  </td>
<td> <?php
// Using MYSQL_FETCH_ASSOC()
// =========================

$keys = Array('A'=> 'Active');
$delim_data=$out=NULL;
$query = "STATUS_CODE";
$result = mysql_query($result);
// Only one field - index 0 does fine, but this board BREAKS it
while ($row=mysql_fetchrow_array($result)) {
$delim_data = explode(',',$row['whatever']);
for ($i=0;$i<count($delim_data);$i++) {
$keys[$i] = $delim_data[$i];
}
}
if ($delim_data) {
$out = '<table><tr>';
foreach ($delim_data as $key => $value) {
$out .= "<td> Key: $key Value: $value </td>";
}
$out .= '</tr></table>'; }
else { $out = '<p>No records to display</p>'; }
echo $out; ?>

</td>
<td><?php echo $row_Recordset1['SALE_PRICE']; ?>  </td>
<td><?php echo $row_Recordset1['SOLD_PRICE']; ?>  </td>
<td><?php echo $row_Recordset1['PROPERTY_STATE_ID']; ?>  </td>
<td><?php echo $row_Recordset1['STREET_NUMBER']; ?>  </td>
<td><?php echo $row_Recordset1['STREET_NAME']; ?>  </td>
<td><?php echo $row_Recordset1['STREET_TYPE']; ?>  </td>
<td><?php echo $row_Recordset1['S

brimike007

10:09 pm on Feb 7, 2010 (gmt 0)

10+ Year Member



Your right about the db, this is for my Mother a RE agent and this db is what they gave her, it's a mess.

rocknbil

2:53 am on Feb 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



LOL . . . . nope, that one is my fault. :-)

I am both a Perl and a PHP coder, and switch between the two daily on various projects. Perl and PHP are very close in structure and syntax; not the same, but close.

fetchrow_array is a perl command from the DBI interface module. hahaha . . . . sorry, laughing at myself.

what you want is to change all those to

mysql_fetch_array

Looking at your code, there are some other things wrong. First, understand what you are doing.

1. You build a valid mySQL select statement. $query = "STATUS_CODE"; is not a select statement.

$query = "select * from table";

* means "all fields," you can also specify fields. This becomes important in a second.

$query = "select field1,field2,field3 from table";

2. You execute that query on the database.

$result = mysql_query($query); <-- see? Query the DB with the mySQL select statement

3. This returns a result object we store in $result.

4. If there are rows in that result, we can extract those as an array of results we will store in $row (or $row_Recordset1, this is fine.)

while ($row=mysql_fetch_array($result)) { // NOT mysql_fetchrow_Array, DOH

OR

while ($row_Recordset1=mysql_fetch_array($result)) {

5. NOW . . . if you use select * from, you have to know what the field names are for the table. So this part I'm pretty sure you have right:

<td><?php echo $row_Recordset1['PROPERTY_TYPE_CODE']; ?> </td>
<td><?php echo $row_Recordset1['PROP_TYPE_DESCRIPTION']; ?> </td>
<td><?php echo $row_Recordset1['REMARKS']; ?> </td>
<td>

So the values in the DB should display for those three fields. Note that you have to output these all inside the while loop:

while ($row_Recordset1=mysql_fetch_array($result)) {
// output results here
}
// If you try to output anything from $row here, it will only display the very last one found


Before I go further, I have to know what you're trying to get at after that. What is the structure of your multi-value database field? See post above in which I made some assumptions about. For example, if the field name is "multi_values",

$delim_data = explode(',',$row['multi_values']); // <-- the database field name is multi_values

Here I have to stop, because I need to know what the structure of that is, what it's supposed to represent, and what your desired output is. I could guess and confuse you further . . . not good.

brimike007

1:25 am on Feb 13, 2010 (gmt 0)

10+ Year Member



Hi rocknbil,

Wow, alot to digest. I really appreciate all of your help. I have 2 rows in the db that I need help with. One has just one value either an "a" or "b" etc. I need to give those letters a value and echo the results. The other row has multiple values comma delimted, yes I know should not be structured this way, however the good thing is I do not have to query this column just give them a value and echo the results. Am I making any sense yet?
Brian

brimike007

2:52 pm on Feb 13, 2010 (gmt 0)

10+ Year Member



I am posting the entire page. So you have a better view.
Not sure if the multiple query is having an issue, does the pointer need to be rest as I am just getting a
"query was empy" in that row.


<?php require_once('Connections/mls.php'); ?>

<?php


$currentPage = $_SERVER["PHP_SELF"];

$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_mls, $mls);
$query_Recordset1 = "SELECT * FROM idx";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $mls) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>







<!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" />
<title>Untitled Document</title>
</head>

<body>
<table border="1" align="center">
<tr>
<td>MLS_ID</td>
<td>MLS_LISTING_ID</td>
<td>TLN_FIRM_ID</td>
<td>MLS_OFFICE_NAME</td>
<td>MLS_OFFICE_PHONE</td>
<td>TLN_REALTOR_ID</td>
<td>MLS_MLS_AGENT_NAME</td>
<td>MLS_AGENT_PHONE</td>
<td>LISTING_DATE</td>
<td>LISTING_EXPIRATION_DATE</td>
<td>SOLD_DATE</td>
<td>AVAILABLE_DATE</td>
<td>PROPERTY_TYPE_CODE</td>
<td>PROP_TYPE_DESCRIPTION</td>
<td>REMARKS</td>
<td>STATUS_CODE</td>
<td>SALE_PRICE</td>
<td>SOLD_PRICE</td>
<td>PROPERTY_STATE_ID</td>
<td>STREET_NUMBER</td>
<td>STREET_NAME</td>
<td>STREET_TYPE</td>
<td>STREET_DIRECTION</td>
<td>UNIT_NUMBER</td>
<td>LONGITUDE</td>
<td>LATITUDE</td>
<td>CITY</td>
<td>CITY_ID</td>
<td>ZIP_CODE</td>
<td>ZIP_PLUS4</td>
<td>MLS_AREA</td>
<td>COUNTY</td>
<td>FIPS_COUNTY_CODE</td>
<td>SUBDIVISION</td>
<td>COMMUNITY_NAME</td>
<td>YEAR_BUILT</td>
<td>ACRES</td>
<td>LOT_DIMENSIONS</td>
<td>LOT_SQUARE_FOOTAGE</td>
<td>LOT_SQFOOTAGE_LAND</td>
<td>BUILDING_SQUARE_FOOTAGE</td>
<td>BEDROOMS</td>
<td>BATHS_TOTAL</td>
<td>BATHS_FULL</td>
<td>BATHS_HALF</td>
<td>BATHS_THREE_QUARTER</td>
<td>FIREPLACE_NUMBER</td>
<td>TOTAL_ROOMS</td>
<td>SCHOOL_DISTRICT</td>
<td>SCHOOL_ELEMENTARY</td>
<td>SCHOOL_MIDDLE</td>
<td>SCHOOL_JUNIOR_HIGH</td>
<td>SCHOOL_HIGH</td>
<td>TOTAL_UNITS</td>
<td>TOTAL_BUILDINGS</td>
<td>TOTAL_LOTS</td>
<td>HOA_FEES</td>
<td>OWNERS_NAME</td>
<td>LEGAL</td>
<td>APN</td>
<td>TAXES</td>
<td>TAX_YEAR</td>
<td>SECTION</td>
<td>RANGE</td>
<td>TOWNSHIP</td>
<td>RENT_ON_SEASON</td>
<td>RENT_OFF_SEASON</td>
<td>PHOTO_IND</td>
<td>LAST_MLS_UPDATE_DATE</td>
<td>MASTER_BED</td>
<td>BED2</td>
<td>BED3</td>
<td>BED4</td>
<td>BED5</td>
<td>KITCHEN</td>
<td>BREAKFAST</td>
<td>LAUNDRY</td>
<td>DEN</td>
<td>DINING</td>
<td>FAMILY</td>
<td>LIVING</td>
<td>GREAT</td>
<td>EXTRA</td>
<td>FEATURE_CODES</td>
<td>MLS_OFFICE_ID</td>
<td>MLS_AGENT_ID</td>
<td>VIRTUAL_TOUR_URL</td>
<td>PHOTO_QUANTITY</td>
<td>PHOTO_URL</td>
<td> PHOTO_MOST_RECENT_DATE</td>
</tr>
<?php do { ?>
<tr>
<td><a href="details1.php?recordID=<?php echo $row_Recordset1['MLS_ID']; ?>"> <?php echo $row_Recordset1['MLS_ID']; ?>&nbsp; </a> </td>
<td><?php echo $row_Recordset1['MLS_LISTING_ID']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TLN_FIRM_ID']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['MLS_OFFICE_NAME']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['MLS_OFFICE_PHONE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TLN_REALTOR_ID']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['MLS_MLS_AGENT_NAME']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['MLS_AGENT_PHONE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LISTING_DATE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LISTING_EXPIRATION_DATE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SOLD_DATE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['AVAILABLE_DATE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['PROPERTY_TYPE_CODE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['PROP_TYPE_DESCRIPTION']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['REMARKS']; ?>&nbsp; </td>
<td> <?php

// an array of the KEYS
$keys = Array('A07=>test,C03=>test3,C06=>test4,C15=>test5');
//
$delim_data=$out=NULL;
$query2 = "SELECT FEATURE_CODES FROM idx";
//$result = mysql_query($sql) or die(mysql_error());
$result2 = mysql_query($sql) or die(mysql_error());
// Only one field - index 0 does fine, but this board BREAKS it
while ($row=mysql_fetch_assoc ($result)) {
$delim_data = explode(',',$row['FEATURE_CODES']);
for ($i=0;$i<count($delim_data);$i++) {
$keys[$i] = $delim_data[$i];
}
}
if ($delim_data) {
$out = '<table><tr>';
foreach ($delim_data as $key => $value) {
$out .= "<td> Key: $key Value: $value </td>";
}
$out .= '</tr></table>';
}
else { $out = '<p>No records to display</p>'; }
echo $out;

?>

</td>
<td><?php echo $row_Recordset1['SALE_PRICE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SOLD_PRICE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['PROPERTY_STATE_ID']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['STREET_NUMBER']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['STREET_NAME']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['STREET_TYPE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['STREET_DIRECTION']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['UNIT_NUMBER']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LONGITUDE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LATITUDE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['CITY']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['CITY_ID']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['ZIP_CODE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['ZIP_PLUS4']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['MLS_AREA']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['COUNTY']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['FIPS_COUNTY_CODE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SUBDIVISION']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['COMMUNITY_NAME']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['YEAR_BUILT']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['ACRES']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LOT_DIMENSIONS']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LOT_SQUARE_FOOTAGE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LOT_SQFOOTAGE_LAND']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BUILDING_SQUARE_FOOTAGE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BEDROOMS']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BATHS_TOTAL']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BATHS_FULL']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BATHS_HALF']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BATHS_THREE_QUARTER']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['FIREPLACE_NUMBER']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TOTAL_ROOMS']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SCHOOL_DISTRICT']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SCHOOL_ELEMENTARY']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SCHOOL_MIDDLE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SCHOOL_JUNIOR_HIGH']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SCHOOL_HIGH']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TOTAL_UNITS']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TOTAL_BUILDINGS']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TOTAL_LOTS']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['HOA_FEES']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['OWNERS_NAME']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LEGAL']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['APN']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TAXES']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TAX_YEAR']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['SECTION']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['RANGE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['TOWNSHIP']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['RENT_ON_SEASON']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['RENT_OFF_SEASON']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['PHOTO_IND']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LAST_MLS_UPDATE_DATE']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['MASTER_BED']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BED2']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BED3']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BED4']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BED5']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['KITCHEN']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['BREAKFAST']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LAUNDRY']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['DEN']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['DINING']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['FAMILY']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['LIVING']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['GREAT']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['EXTRA']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['STATUS_CODES']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['MLS_OFFICE_ID']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['MLS_AGENT_ID']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['VIRTUAL_TOUR_URL']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['PHOTO_QUANTITY']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['PHOTO_URL']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1[' PHOTO_MOST_RECENT_DATE']; ?>&nbsp; </td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<br>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">First</a>
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Previous</a>
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Next</a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Last</a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
Records <?php echo ($startRow_Recordset1 + 1) ?> to <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> of <?php echo $totalRows_Recordset1 ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>