473,219 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,219 software developers and data experts.

Trouble extracting info from database

Ah, I hope it's okay to keep posting questions, and sorry for the
vague subject line. This is my problem: I've got a database set
up with 7 fields: ID, Album, Year, Type, Songs, Members,
Production. I've built a dynamic table that list Album, Year and
Type, and when you click on Album, the other info is supposed to
appear to the left. Well, it does, for the first entry, but not
for subsequent entries. Here's the code from the top of the page:

***

<?php require_once('Connections/gong.php'); ?>
<?php
$order=$_GET['order'];
$sort_order = 'Year';
if($order == 'Album'){
$sort_order = 'Album';
}else if($order == 'Year') {
$sort_order = 'Year';
}else if($order == 'Type'){
$sort_order = 'Type';
}

$album=$_GET['album'];

mysql_select_db($database_gong, $gong);
$query_rsGongBand = "SELECT * FROM gong_band ORDER BY $sort_order
ASC";
$rsGongBand = mysql_query($query_rsGongBand, $gong) or die
(mysql_error());
$row_rsGongBand = mysql_fetch_assoc($rsGongBand);
$totalRows_rsGongBand = mysql_num_rows($rsGongBand);
?>

***

And here's the code from the body section:

***

<?php if ($album) { ?>
<h3><?php echo $row_rsGongBand['Album']; ?></h3>
<?php
echo $row_rsGongBand['Songs'];
echo $row_rsGongBand['Members'];
echo $row_rsGongBand['Production'];
?>

<?php } ?>

***

And the sort table:

***

<thead>
<tr>
<td><a href="<?php print $_SERVER['PHP_SELF']."?order=Album";
?>">Album</a></td>
<td><a href="<?php print $_SERVER['PHP_SELF']."?order=Year";
?>">Year</a></td>
<td><a href="<?php print $_SERVER['PHP_SELF']."?order=Type";
?>">Type</a></td>
</tr>
</thead>
<tbody>
<?php do { ?>
<?php
$class = ($class == 'odd') ? 'even' : 'odd';
?>
<tr class="<?php echo $class ?>">
<td><a href="<?php print $_SERVER['PHP_SELF']."?album=".
$row_rsGongBand['Album'];
?>">
<?php echo $row_rsGongBand['Album']; ?></a></td>
<td><?php echo $row_rsGongBand['Year']; ?></td>
<td><?php echo $row_rsGongBand['Type']; ?></td>
</tr>
<?php } while ($row_rsGongBand = mysql_fetch_assoc
($rsGongBand)); ?>
</tbody>

***

What I need is to pull information from a specific row of the
database, based on what the album name is in the URL, but instead
it's giving me the information from the first row. I think the
$album variable is the key, but at the moment I don't seem to be
using it, as it was left over from a different version of the
page.

Thanks for answering all my numerous questions. :-) I'm slowly
getting my mind around all of this.

Ian
--
http://www.bookstacks.org/
Jul 17 '05 #1
1 1443
Okay, I've solved that problem and moved on to an entirely different
one! I won't trouble the group with it, though. Just wanted to say I
don't need an answer, and do appreciate the other help I've gotten.
Diving right in to PHP has its benefits, but it's times like this I
wish I were a comp sci student rather than self-taught. :-)

Ian
--
http://www.bookstacks.org/
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Calvin FONG | last post by:
Dear all, Are there any utility that can be call by python to create self extracting zip file. I'm now using the powerarchiever. But the command line options aren't flexible enough. Basically, I...
2
by: Chris Belcher | last post by:
First some background... The database tracks Action Items assigned to a group of 20 or so managers. Once the assignment is created it is then emailed to each of the managers that are included in...
3
by: dave | last post by:
Hi there, I'm trying to extract formatting information from the columns in a database field and use it to format data bound text boxes in a VB6 application. I can't find a way to get the format...
4
by: anwar | last post by:
Hi all, I have a task to extract DB2 table data to csv file from shell script. i have to execute a sql query and the retreived data should be moved to csv file. If i get a solution, ll be very...
1
by: JackM | last post by:
I'm not sure how I need to proceed on this and can use a bit of advice. I have a non-profit's web site that wishes to allow their members to fill out information regarding summer camp information...
6
by: Rico | last post by:
Hello, I'm creating an audit table and associated triggers to be able to capture any updates and deletes from various tables in the database. I know how to capture the records that have been...
1
by: final farewell | last post by:
Hello, I am using Ekhau Location Tracking System for an assignment. It is a system that is able to track configured tags attached to people or objects. I am new to the Ekahau Location Tracking...
6
by: geegeegeegee | last post by:
Hi All, I have come across a difficult problem to do with extracting UniCode characters from RTF strings. A detailed description of my problem is below, if anyone could help, it would be much...
22
by: sivadhanekula | last post by:
Hello Everyone A quick and direct question: I need a C/C++ program to extract the data from the database and the output should be in CSV "Comma Separated Value" format. Briefly: I will be given a...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.