Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,495 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,695 people online right now. Registration is fast and FREE... Join Now!




somethings wrong with my query i think

 
Reply to this topicStart new topic

somethings wrong with my query i think

capty99
2 Mar, 2008 - 10:53 PM
Post #1

the real kya
Group Icon

Joined: 26 Apr, 2001
Posts: 9,164



Thanked: 16 times
Dream Kudos: 550
My Contributions
okay, here is my code, which works fine on one page... but on a seperate seciton of the site seems to only display one item in the sublist.

its a rollover nav that can be found here : relocate.youraddressmagazine.com

php

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" media="all" type="text/css" href="flyout.css" />
<!--[if lte IE 6]>
<link rel="stylesheet" media="all" type="text/css" href="view/flyout_ie.css" />
<![endif]-->
</head>

<body>
<?php
// includes
include("conf.php");

// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");

// select database
mysql_select_db($db) or die ("Unable to select database!");

// generate and execute query
$query = "SELECT DISTINCT type FROM relocate ORDER BY type";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if records present
if (mysql_num_rows($result) > 0)
{
?>
<?php
// iterate through resultset
// print article titles
while($row = mysql_fetch_object($result))
{
?>

<div class="menu">

<ul>
<li><a href="";><? echo $row-> type; ?></a>



<ul>
<?
$query = "SELECT id, name FROM relocate WHERE type = '" . $row->type ."' ORDER BY name" ;
$result2 = mysql_query($query) or die ("Error in query: $query. " . mysql_error());

if (mysql_num_rows($result) > 0)
{
while($row2 = mysql_fetch_object($result2))
{
?>
<li><a href="index.php?content=stores_fullview&id=<? echo $row2-> id; ?>"><? echo $row2-> name; ?></a></li>
<? } } ?> </ul>

</li>

</ul>

</div>
<? }
}
// if no records present
// display message
else
{
?>
Sorry, please check back later, we are experiencing some technical issues. Thanks.
Error Message : No records present.</font>
<?
}

// close database connection
mysql_close($connection);
?>
</body>

</html>


for some reason when you roll over 'austin facts' only one item is displayed instead of the three that exist.

it works fine for shop.youraddressmagazine.com

i'm not sure what the deal s
User is offlineProfile CardPM
+Quote Post

capty99
RE: Somethings Wrong With My Query I Think
2 Mar, 2008 - 11:01 PM
Post #2

the real kya
Group Icon

Joined: 26 Apr, 2001
Posts: 9,164



Thanked: 16 times
Dream Kudos: 550
My Contributions
eh... actually the css. got it fixed thanks for looking.
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Somethings Wrong With My Query I Think
2 Mar, 2008 - 11:01 PM
Post #3

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,465



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(capty99 @ 3 Mar, 2008 - 12:01 AM) *

thanks for looking.

You're welcome!

Glad to hear you got it resolved.
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 08:00PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month