GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Jul-2003, 03:07
norok norok is offline
New Member
 
Join Date: Jun 2003
Posts: 23
norok is an unknown quantity at this point

Problem with array


Hi,
in my library the location of the found book should be shown,
but unfortunately the locations are all displayed under
the first book and all locations are only listed.
I want every location to be displayed under the corresponding book, but I don't know why it allways shows me all locations, because the command for it is included in a while construct which works out all the results, that means one book after the other.

Here the code:
PHP Code:

//Query for standort:
       $result3 = mysql_query 
       ("SELECT name FROM standort LEFT JOIN titles using(standortID)");
               mysql_query($result3);
...
  
              $namecount=0;
      while ($row = mysql_fetch_object($result3)){
               $namecount++;
                      echo $row->name ? "<br>Standort: <i>" . htmlentities($row->name) ."</i>" :"",
                 "</li>\n"; 


It would be great to get this fixed,
thanx

Matthias
  #2  
Old 11-Jul-2003, 06:11
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
I cannot imagine your database structure/data or output norok, so please use the [code] tags to show a sample output off this script and what you expect from a fix.
  #3  
Old 11-Jul-2003, 09:11
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
you know you do a mysql_query inside a mysql_query

just a note...
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #4  
Old 16-Jul-2003, 02:08
norok norok is offline
New Member
 
Join Date: Jun 2003
Posts: 23
norok is an unknown quantity at this point

Ok,here is the code of the outputhtml


PHP Code:

<!-- php/mylibrary/find.php>


<!-- start of html document if no connection error has happened -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html><head>
<title>BBH München Bücherdatenbank - Suchformular</title>
</head><body>
<h2>Suche Titel in der Bibliotheksdatenbank</h2>

<p>Suche nach Titeln, die mit <i><b>a</b > beginnen</i>:
1<form action="ergebnisse.php" method="post"><hr><ul>
<p><li><a href="./find.php?sqlType=title&authID=64">Papperitz</a>, <a href="./find.php?sqlType=title&authID=65">Keller</a>: <b>ABC Betriebspr&uuml;fung</b><br><a href="./find.php?sqlType=title&publID=14">Stollfu&szlig; Bonn</a>, 1997 <br>Edition: 3 <br>Buchnummer: AO.01.03 <br>Sprache: <i>deutsch</i> <br>Kategorie: <i>Abgabenordnung</i> 0<br>Standort: <i>Bibliothek</i></li>
<br>Standort: <i>Bibliothek</i></li>
<br>Standort: <i>Bibliothek</i></li>
<br>Standort: <i>Bibliothek</i></li>
<br>Standort: <i>Bibliothek</i></li>
<br>Standort: <i>Bibliothek</i></li>
<br>Standort: <i>Bibliothek</i></li>
<br>Standort: <i>Bibliothek</i></li>
<br>Standort: <i>Bibliothek</i></li>
<br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br><p><li><a href="./find.php?sqlType=title&authID=61">Tipke</a>, <a href="./find.php?sqlType=title&authID=62">Kruse</a>: <b>Abgabenordnung / Finanzgerichtsordnung</b><br><a href="./find.php?sqlType=title&publID=13">Dr. Otto Schmidt</a><br>Buchnummer: AO.00.01 <br>Sprache: <i>deutsch</i> <br>Kategorie: <i>Abgabenordnung</i> <br>Kommentar: <i>Teilband I</i> 0<br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br><p><li><a href="./find.php?sqlType=title&authID=63">Tipke; Kruse</a>: <b>Abgabenordnung / Finanzgerichtsordnung</b><br><a href="./find.php?sqlType=title&publID=13">Dr. Otto Schmidt</a><br>Buchnummer: AO.00.02 <br>Sprache: <i>deutsch</i> <br>Kategorie: <i>Abgabenordnung</i> <br>Kommentar: <i>Teilband II</i> 0<br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br><p><li><a href="./find.php?sqlType=title&authID=61">Tipke</a>, <a href="./find.php?sqlType=title&authID=62">Kruse</a>: <b>Abgabenordnung / Finanzgerichtsordnung</b><br><a href="./find.php?sqlType=title&publID=13">Dr. Otto Schmidt</a><br>Buchnummer: AO.00.03 <br>Sprache: <i>deutsch</i> <br>Kategorie: <i>Abgabenordnung</i> <br>Kommentar: <i>Teilband III</i> 0<br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br><p><li><a href="./find.php?sqlType=title&authID=70">H&uuml;ffer</a>: <b>Aktiengesetz</b><br><a href="./find.php?sqlType=title&publID=15">C. H. Beck</a>, 1999 <br>Edition: 4 <br>Buchnummer: AktG.01.04 <br>Sprache: <i>deutsch</i> <br>Kategorie: <i>Aktienrecht</i> 0<br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br>Standort : <select name="formStandort" size=1><option value="none">(wähle)<option value="1"> von Weidenbach
<option value="2"> Umlauft
<option value="3"> St&ouml;ckl
<option value="4"> Bibliothek
</select>
<input type="submit" name="submitlocation" value="Auswahl bestätigen"><p><a href="./find.php">Zurück zum Suchformular.</a>

</body></html> 


The problem is that the names where the books are located dont
appear under the corresponding book, but all in one list under the first book.

Matthias
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting a 2D array c++ mike3340 C++ Forum 4 15-Dec-2003 13:35
Extra null element in an array samtediou MySQL / PHP Forum 2 11-Dec-2003 11:52
problem with php5 cgi installation fab13 Apache Web Server Forum 3 19-Nov-2003 09:11
unwanted scrollbar problem kelly001 Web Design Forum 3 24-Oct-2003 10:44
deleting from an array ionyka C++ Forum 1 02-Sep-2003 03:09

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:39.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.