Help with dynamic links generated from mysql, using php and iframes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a database (frencheng) with, let's say, three columns ["id", 
int(9) ; "frc", text ; "eng", text ]. Field "id" is set to 
auto_increment starting at number 1.

The database contains a list of french words in column 2 and the 
translated english words in column 3.


>From the page below, using two iframes, I need the second frame 
(inlineframe2) to display the full list of french words in the 
database, sorted by the id column, with each word being a clickable 
link (generated dynamically from the mysql query in frenchlist.php).

Each of the links, once clicked,is to run another query on the same 
database that will display, on iframe 1 (inlineframe1) just the one 
english word for that link.

I'm very new to mysql, iframes and php. It took me forever just to 
get what I have below working, and need help to get this done. If 
it's not do-able, I'd also like to know.

thanks

Tifu
   

 


words.html (Main page with two iframes )
========================================


<html>
<head>
<title>Translate</title>
<body>

<iframe name="inlineframe1" src="englishword.php" width=487 height=40 
marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 
scrolling=no
 >Sorry, your browser doesn't support inline frames.</iframe>

<iframe name="inlineframe2" src="frenchlist.php" width=487 height=200 
marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 
scrolling=auto
>Sorry, your browser doesn't support inline frames.</iframe>

</body>
</html>



======================================================================

frenchlist.php
==============


<html>
<head>
<title>Frenchlist</title>

<body bgcolor="#F5E1CD">

<table border="1">
<?php
include 'db_info.php';
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");

$sql = "SELECT * FROM frencheng ORDER BY id";
$result = mysql_query($sql);
$num = mysql_num_rows($result);

$i=0;
while ($i < $num) {

	$id=mysql_result($result,$i,"id");
	$swa=mysql_result($result,$i,"frc");
	$eng=mysql_result($result,$i,"eng");
	if($eng=="")$eng="&nbsp;";
	echo ("<pre>-&nbsp;$frc</pre>");
	$i++;


}
?>
</table>
</body>
</html>


======================================================================


englishword.php
===============



<html>
<head>
<title>englishword</title>

<body bgcolor="#FAF0E6">



???


</table>
</body>
</html>


======================================================================


dbinfo.php
===============


<?php
$location = "mysql7.hotserver.com";
$username = "bozo";
$password = "theclown";
$database = "frencheng";
?>








PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux