hola a todos soy nuevo en esto y mucho no entiendo necesito hacer un proyecto de una tienda online y la verdad tengo muchas complicaciones con mis bases de datos quiero hacer un menu con dos tablas una que son las categorias q se llama tblCategorias y otra que se llama tblPais y los dos tienen lo mismo el id y la desccripcion y lo unico que haces y que probe es que me muestre las categorias con sus respectivos productos ahora lo que yo quiero lograr es que me muestre los productos pero q si pongo un pais que me muestre los productos
por ejemplo
categoria 1
españa
brazil
categoria 2
argentina
españa
brazil
lo que digo es que cuando yo hago clic que me muestre las subcategorias y los productos pero cuando hago clic en la subcategoria q me muestre los productos de cate1 pero que sean de ese pais
y el codigo de lo que tengo asta ahora
<?php require_once('Connections/datos.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_datos, $datos);
$query_Recordset1 = "SELECT * FROM tblCategoria ORDER BY tblCategoria.strDescripcion";
$Recordset1 = mysql_query($query_Recordset1, $datos) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php do { ?>
<a href="categoria_ver.php?cat=<?php echo $row_Recordset1['idCategoria']; ?>">
<?php echo $row_Recordset1['strDescripcion']; ?></a><br>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<?php
mysql_free_result($Recordset1);
?>