Forums

This topic is locked

Help needed on Php-Mysql, data does not show up pr

Posted 08 Oct 2002 03:17:21
1
has voted
08 Oct 2002 03:17:21 Manou Manou posted:

Hi;
I am trying to make a database driven webpage,
I made a database contain of 11 tables:

Company company_Id, logo, company, category_id

Category category_Id, category

Name name_Id, name, company_Id

Phone phone_Id, phone, company_Id


and so on for the rest of tables, there are also relaitonship between all these tables as follows:
company_Id column of company table to all the company_id column in other 9 tables.
and category_Id column from category table is related to category_Id column in company table.

I could not make a proper page for showing the category as pull down,
I just made a page with all the category in it, so if you click on any category it should show the respective companies with their data in the page.
the problem is when clicking on any category, only one data show up, and that is the first company with its data, it does not matter what category I click always it shows up that company ( only one data, and that is no 1 in the database company table).
I can not figure it out what is wrong,

I have used DWMX and Php and Mysql. running on Win Xp.

I appreciate any help, I am a newbie and don't know about PHP and Mysql,
just learning Mysql.
Thanx,

and this the source of it.
-----------------------------------------------------------------
<?php require_once('Connections/connABCTest.php'); ?>
<?php
mysql_select_db($database_connABCTest, $connABCTest);
$query_rsCategory = "SELECT * FROM category";
$rsCategory = mysql_query($query_rsCategory, $connABCTest) or die(mysql_error());
$row_rsCategory = mysql_fetch_assoc($rsCategory);
$totalRows_rsCategory = mysql_num_rows($rsCategory);
?>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/connABC.asp" -->
<!--#include file="Connections/connABC.asp" -->
<%
Dim rsCategory
Dim rsCategory_numRows

Set rsCategory = Server.CreateObject("ADODB.Recordset"
rsCategory.ActiveConnection = MM_connABC_STRING
rsCategory.Source = "SELECT * FROM category"
rsCategory.CursorType = 0
rsCategory.CursorLocation = 2
rsCategory.LockType = 1
rsCategory.Open()

rsCategory_numRows = 0
%>
<%
Dim rsCategory
Dim rsCategory_numRows

Set rsCategory = Server.CreateObject("ADODB.Recordset"
rsCategory.ActiveConnection = MM_connABC_STRING
rsCategory.Source = "SELECT * FROM category"
rsCategory.CursorType = 0
rsCategory.CursorLocation = 2
rsCategory.LockType = 1
rsCategory.Open()

rsCategory_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<table width="563" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="148" height="234" valign="top"><?php do { ?>
<a href="detail_page.php"><?php echo $row_rsCategory['cagegory']; ?></a>
<?php } while ($row_rsCategory = mysql_fetch_assoc($rsCategory)); ?> </td>
<td width="415"> </td>
</tr>
<tr>
<td height="443"> </td>
<td> </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsCategory);
?>

<%
rsCategory.Close()
Set rsCategory = Nothing
%>
<%
rsCategory.Close()
Set rsCategory = Nothing
%>




Edited by - Manou on 08 Oct 2002 07:09:17

Replies

Replied 09 Oct 2002 14:46:35
09 Oct 2002 14:46:35 Alex Kanakaris replied:
Try to use a server behavior, "repeat region" and then all of them will be visible.

Reply to this topic