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
  #11  
Old 30-Jun-2003, 04:57
norok norok is offline
New Member
 
Join Date: Jun 2003
Posts: 23
norok is an unknown quantity at this point

Ok,but something's still wrong


Hi,
the code is now:
PHP Code:

$title_id = intval($titleID); /*  Forgot to mention this before...
                                       make sure type is (int); IMPORTANT!  */
        $sql = 'SELECT SO.vorname, SO.name, SO.userID
                       FROM rel_titel_user AS RTU, Standort AS SO
                       WHERE RTU.titelID = '.$title_id.'
                       AND SO.userID = RTU.userID';  // I missed out the O in SO here
        $result3 = mysql_query( $sql );
            // I suppose this could return more than one row, huh?
        echo "<ol>\n";
        // to extend: use mysql_num_rows() to check if empty or n/a...
         while( $row = mysql_fetch_assoc($result3) )
        {
          echo     '  <li>Location: '.$row['vorname'].', '.$row['name']."</li>\n";
        }
        echo "</ol>\n"; 


And I get the following statemaent:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in d:\programme\apache group\apache\htdocs\bibli\find.php on line 314

Sorry, that I bother you with that, but the german forum
guys are not able to help me.

Matthias
  #12  
Old 30-Jun-2003, 05:23
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
To figure out what exactly is going wrong, rewrite the code...

PHP Code:

<?php
$title_id = intval( $titleID );
$sql = 'SELECT SO.vorname, SO.name, SO.userID
        FROM rel_titel_user AS RTU, Standort AS SO
        WHERE RTU.titelID = '.$title_id.'
        AND SO.userID = RTU.userID';
$result3 = mysql_query( $sql )
           // add this line
           or die( mysql_errno().': '.mysql_error() ); 
echo "<ol>\n";
while( $row = mysql_fetch_assoc($result3) )
{
  echo     '  <li>Location: '.$row['vorname'].', '.$row['name']."</li>\n";
}
echo "</ol>\n";
?>

  #13  
Old 30-Jun-2003, 06:34
norok norok is offline
New Member
 
Join Date: Jun 2003
Posts: 23
norok is an unknown quantity at this point

****in goode idea!!


Goodidea, there was a spelling problem titel !=title-
Now no error occurs, but the location, so standort is not shown.
Hereis the result html:
[php]
<!-- php/mylibrary/find.php -*- C++ -*- -->


<!-- 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>z</b > beginnen</i>:
<form action="ergebnisse.php" method="post"><hr><ul>
<p><li><a href="./find.php?sqlType=title&authID=46">Dr. Heinz Putzo</a>, <a href="./find.php?sqlType=title&authID=47">Dr. Hans Thomas</a>: <b>ZPO</b><br>Edition: 23 <br>Sprache: <i>deutsch</i> </li>
<br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br><ol>
</ol>
<p><li><a href="./find.php?sqlType=title&authID=46">Dr. Heinz Putzo</a>, <a href="./find.php?sqlType=title&authID=47">Dr. Hans Thomas</a>: <b>ZPO-Kommentar</b><br><a href="./find.php?sqlType=title&publID=10">C.H.Beck M&uuml;nchen</a>, 1999 <br>Edition: 22 <br>Sprache: <i>deutsch</i> <br>Kommentar: <i>Kommentar zu ZPO</i> </li>
<br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br><ol>
</ol>
Standort : <select name="formStandort" size=1><option value="none">(wähle)<option value="4"> Bibliothek
<option value="5"> Ladenburger
<option value="3"> St&ouml;ckl
<option value="2"> Umlauft
<option value="1"> von Weidenbach
</select>
<input type="submit" value="Auswahl bestätigen"><p><a href="./find.php">Zurück zum Suchformular.</a>

</body></html>


[php]

Matthias
  #14  
Old 30-Jun-2003, 07:30
norok norok is offline
New Member
 
Join Date: Jun 2003
Posts: 23
norok is an unknown quantity at this point

****in good idea tocheck the errors, but..


Good idea, there was a spelling problem titel !=title-
Now no error occurs, but the location, so standort is not shown.
Here is the result html:
HTML Code:
<!-- php/mylibrary/find.php -*- C++ -*- --> <!-- 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>z</b > beginnen</i>: <form action="ergebnisse.php" method="post"><hr><ul> <p><li><a href="./find.php?sqlType=title&authID=46">Dr. Heinz Putzo</a>, <a href="./find.php?sqlType=title&authID=47">Dr. Hans Thomas</a>: <b>ZPO</b><br>Edition: 23 <br>Sprache: <i>deutsch</i> </li> <br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br><ol> </ol> <p><li><a href="./find.php?sqlType=title&authID=46">Dr. Heinz Putzo</a>, <a href="./find.php?sqlType=title&authID=47">Dr. Hans Thomas</a>: <b>ZPO-Kommentar</b><br><a href="./find.php?sqlType=title&publID=10">C.H.Beck München</a>, 1999 <br>Edition: 22 <br>Sprache: <i>deutsch</i> <br>Kommentar: <i>Kommentar zu ZPO</i> </li> <br><b>Buch entleihen: </b><input type="checkbox" name="Marker[]" value=""></br><ol> </ol> Standort : <select name="formStandort" size=1><option value="none">(wähle)<option value="4"> Bibliothek <option value="5"> Ladenburger <option value="3"> Stöckl <option value="2"> Umlauft <option value="1"> von Weidenbach </select> <input type="submit" value="Auswahl bestätigen"><p><a href="./find.php">Zurück zum Suchformular.</a> </body></html>

Matthias
 
 

Recent GIDBlogAccepted for Ph.D. program 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
SQL multiple languages query samtediou MySQL / PHP Forum 6 23-Jul-2003 14:09
mysql vs sql - what is the difference zabell MySQL / PHP Forum 2 14-Jun-2003 17:32
Search Engine Positioning 101 and 201 "How To" Tips... 000 Search Engine Optimization Forum 0 29-May-2003 11:34

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

All times are GMT -6. The time now is 18:40.


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