bigbird3156
Programmer
Hi I am trying to view records on my data base according to a text based field rather than a numerical one...
I cant get it to work... at this stage it simply shows all records from the database, not just the ones that were passed to it...
Here is the code that passes the value to the page... it seems to work if the url is anything to go by...
and here is the code from the actual display page...
I tried changing the $colname_view_des_cat = "-1"; line to text instead of -1 because I think I heard that was needed somewhere but it did not seem to make any difference...
can someone give me some leads...
thanks heaps
The Bird from Down Under- Bigbird 3156
Programmer?? - I thought the option was pretender not programmer!!
I cant get it to work... at this stage it simply shows all records from the database, not just the ones that were passed to it...
Here is the code that passes the value to the page... it seems to work if the url is anything to go by...
Code:
<a href="des_cat.php?designer=<?php echo $row_view_catalogue["designer"]; ?>">
Code:
$colname_view_des_cat = "-1";
if (isset($_GET['designer'])) {
$colname_view_des_cat = $_GET['designer'];
}
mysql_select_db($database_CA_database, $CA_database);
$query_view_des_cat = sprintf("SELECT rec_num, prod_num, prod_name, designer FROM products WHERE designer = %d, GetSQLValueString($colname_view_des_cat, "text"));
$view_des_cat = mysql_query($query_view_des_cat, $CA_database) or die(mysql_error());
$row_view_des_cat = mysql_fetch_assoc($view_des_cat);
$totalRows_view_des_cat = mysql_num_rows($view_des_cat);
?>
Code:
<?php do { ?>
<table width="100%" border="0">
<tr>
<td width="18%"><?php echo $row_view_des_cat['rec_num']; ?></td>
<td width="19%"><?php echo $row_view_des_cat['prod_num']; ?></td>
<td width="39%"><?php echo $row_view_des_cat['prod_name']; ?></td>
<td width="24%"><?php echo $row_view_des_cat['designer']; ?></td>
</tr>
</table>
<?php } while ($row_view_des_cat = mysql_fetch_assoc($view_des_cat)); ?>
</body>
</html>
<?php
mysql_free_result($view_des_cat);
?>
I tried changing the $colname_view_des_cat = "-1"; line to text instead of -1 because I think I heard that was needed somewhere but it did not seem to make any difference...
can someone give me some leads...
thanks heaps
The Bird from Down Under- Bigbird 3156
Programmer?? - I thought the option was pretender not programmer!!