Jump to content

torres

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

torres's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all! Thank you very much noobie! It worked!! The problem was that, as you know (i didn't), dreamweaver don't delete unnecessary code generated after arranging and re-arranging url parameters for the dinamic links!! So...i've tryed to rebuild my sub_cat php page and it worked!! the new code is: <?php require_once('../Connections/MySQL_connection.php'); ?> <?php $colname_Subcategorias = "1"; if (isset($_GET['categoria_link'])) { $colname_Subcategorias = (get_magic_quotes_gpc()) ? $_GET['categoria_link'] : addslashes($_GET['categoria_link']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_Subcategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s'", $colname_Subcategorias); $Subcategorias = mysql_query($query_Subcategorias, $MySQL_connection) or die(mysql_error()); $row_Subcategorias = mysql_fetch_assoc($Subcategorias); $totalRows_Subcategorias = mysql_num_rows($Subcategorias); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .style1 {font-family: Verdana, Arial, Helvetica, sans-serif} --> </style> </head> <body> <table width="207" border="1" cellspacing="2" cellpadding="2"> <tr> <th width="195" scope="col"><div align="center" class="style1">Sub-Categorias Comerciais </div></th> </tr> <?php do { ?> <tr> <td><a href="lojas.php?sub_categorias=<?php echo $row_Subcategorias['ID_Sub_Cat']; ?>"><?php echo $row_Subcategorias['Nome_Sub_Cat']; ?></a></td> </tr> <?php } while ($row_Subcategorias = mysql_fetch_assoc($Subcategorias)); ?> </table> </body> </html> <?php mysql_free_result($Subcategorias); ?> *********************************************** Cheers!! Long Life to phpfreaks.com!! António Portugal, Europe torrezzzz@hotmail.com
  2. Hi all freaks!! I'm working on a Local Commerce WebGIS application for a final master thesis and i'm having troubles with the dynamic links. I have the following database structure: Comercial categories ID_CAT Categorie Comercial Sub-Categories ID_CAT ID_SUB_CAT Sub_Categorie (and then the comercial stores table wich dont matter for this case) When i try to make dynamic link with the ID_CAT to the Sub_Categorie matching the same ID_CAT i get the following error: Parse error: parse error, unexpected T_STRING, expecting ']' in C:\ServidorGis\web\Database\subcategorias.php on line 14 the code for the subcategories.php is: (line 14 is in bold) can anyone please tell me what am i doing wrong?? Thanks in advance! Torres, Portugal ********************************************** <?php require_once('../Connections/MySQL_connection.php'); ?> <?php $colname_Subcategorias = "1"; if (isset($_GET['categorias_link'])) { $colname_Subcategorias = (get_magic_quotes_gpc()) ? $_GET['categorias_link'] : addslashes($_GET['categorias_link']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_Subcategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s' ORDER BY Nome_Sub_Cat ASC", $colname_Subcategorias); $Subcategorias = mysql_query($query_Subcategorias, $MySQL_connection) or die(mysql_error()); $row_Subcategorias = mysql_fetch_assoc($Subcategorias); $totalRows_Subcategorias = mysql_num_rows($Subcategorias); $colname_Subcategorias = "1"; if (isset($_GET['<?php echo $row_Categorias['ID_Cat']; ?> '])) { $colname_Subcategorias = (get_magic_quotes_gpc()) ? $_GET['<?php echo $row_Categorias['ID_Cat']; ?>'] : addslashes($_GET['<?php echo $row_Categorias['ID_Cat']; ?>']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_Subcategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s'", $colname_Subcategorias); $Subcategorias = mysql_query($query_Subcategorias, $MySQL_connection) or die(mysql_error()); $row_Subcategorias = mysql_fetch_assoc($Subcategorias); $totalRows_Subcategorias = mysql_num_rows($Subcategorias); $colname_Subcategorias ="1"; if (isset($_GET['<?php echo $row_Categorias['ID_Cat']; ?>'])) { $colname_Subcategorias = (get_magic_quotes_gpc()) ? $_GET['<?php echo $row_Categorias['ID_Cat']; ?>'] : addslashes($_GET['<?php echo $row_Categorias['ID_Cat']; ?>']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_Subcategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s'", $colname_Subcategorias); $Subcategorias = mysql_query($query_Subcategorias, $MySQL_connection) or die(mysql_error()); $row_Subcategorias = mysql_fetch_assoc($Subcategorias); $totalRows_Subcategorias = mysql_num_rows($Subcategorias); $colname_Subcategorias ="1"; if (isset($_GET['<?php echo $row_Categorias['ID_Cat']; ?>'])) { $colname_Subcategorias = (get_magic_quotes_gpc()) ? $_GET['<?php echo $row_Categorias['ID_Cat']; ?>'] : addslashes($_GET['<?php echo $row_Categorias['ID_Cat']; ?>']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_Subcategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s'", $colname_Subcategorias); $Subcategorias = mysql_query($query_Subcategorias, $MySQL_connection) or die(mysql_error()); $row_Subcategorias = mysql_fetch_assoc($Subcategorias); $totalRows_Subcategorias = mysql_num_rows($Subcategorias); $colname_SubCategorias ="1"; if (isset($_GET['<?php echo $row_Categorias['ID_Cat']; ?> '])) { $colname_SubCategorias = (get_magic_quotes_gpc()) ? $_GET['<?php echo $row_Categorias['ID_Cat']; ?>'] : addslashes($_GET['<?php echo $row_Categorias['ID_Cat']; ?>']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_SubCategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s'", $colname_SubCategorias); $SubCategorias = mysql_query($query_SubCategorias, $MySQL_connection) or die(mysql_error()); $row_SubCategorias = mysql_fetch_assoc($SubCategorias); $totalRows_SubCategorias = mysql_num_rows($SubCategorias); $colname_SubCategorias ="1"; if (isset($_GET['<?php echo $row_Categorias['ID_Cat']; ?>'])) { $colname_SubCategorias = (get_magic_quotes_gpc()) ? $_GET['<?php echo $row_Categorias['ID_Cat']; ?>'] : addslashes($_GET['<?php echo $row_Categorias['ID_Cat']; ?>']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_SubCategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s'", $colname_SubCategorias); $SubCategorias = mysql_query($query_SubCategorias, $MySQL_connection) or die(mysql_error()); $row_SubCategorias = mysql_fetch_assoc($SubCategorias); $totalRows_SubCategorias = mysql_num_rows($SubCategorias); $colname_SubCategorias ="1"; if (isset($_SESSION['<?php echo $row_Categorias['ID_Cat']; ?>'])) { $colname_SubCategorias = (get_magic_quotes_gpc()) ? $_SESSION['<?php echo $row_Categorias['ID_Cat']; ?>'] : addslashes($_SESSION['<?php echo $row_Categorias['ID_Cat']; ?>']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_SubCategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s'", $colname_SubCategorias); $SubCategorias = mysql_query($query_SubCategorias, $MySQL_connection) or die(mysql_error()); $row_SubCategorias = mysql_fetch_assoc($SubCategorias); $totalRows_SubCategorias = mysql_num_rows($SubCategorias); $colname_SubCategorias ="1"; if (isset($_GET['<?php echo $row_Categorias['ID_Cat']; ?>'])) { $colname_SubCategorias = (get_magic_quotes_gpc()) ? $_GET['<?php echo $row_Categorias['ID_Cat']; ?>'] : addslashes($_GET['<?php echo $row_Categorias['ID_Cat']; ?>']); } mysql_select_db($database_MySQL_connection, $MySQL_connection); $query_SubCategorias = sprintf("SELECT * FROM com_sub_cat WHERE ID_Cat = '%s'", $colname_SubCategorias); $SubCategorias = mysql_query($query_SubCategorias, $MySQL_connection) or die(mysql_error()); $row_SubCategorias = mysql_fetch_assoc($SubCategorias); $totalRows_SubCategorias = mysql_num_rows($SubCategorias); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .style1 {font-family: Verdana, Arial, Helvetica, sans-serif} --> </style> </head> <body> <table width="228" border="1" cellspacing="2" cellpadding="2"> <tr> <th width="216" scope="col"><span class="style1">Sub-Categorias Comerciais </span></th> </tr> <?php do { ?> <tr> <td><?php echo $row_Subcategorias['Nome_Sub_Cat']; ?></td> </tr> <?php } while ($row_Subcategorias = mysql_fetch_assoc($Subcategorias)); ?> </table> </body> </html> <?php mysql_free_result($Subcategorias); mysql_free_result($SubCategorias); ?> *********************************************************
  3. Hi All Need help friends!! I have a mysql database consisting in 3 tables, comercial categories, comercial sub-categories and stores. what i need to do is link the categorie to the correspondent sub-categories and, obviously, sub-categories to correspondent stores. The database is relational and all the tables got primary ID that is linked to the correspondent ID from the secundary table. In resume: all is defined and up to point with the database. My question is how i do this in dreamweaver mx? Hope not to be very confusing Thanks in advance Torres Portugal
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.