For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > February 2007 > Ways to display remaining data columns.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Ways to display remaining data columns.
Chris Carter

2007-02-03, 6:58 pm


Hi,

What I am trying to achieve is this,

From the results table, when the user clicks on the last column of the row
which has a label "Details" of a particular item. A pop up window opens and
has some description and contact number which comes from the database.

I have a database with 8 columns but at first I display only 6. And I give
an option of "Details" on each column. If user clicks on this the the
remaining 2 columns are displayed on a separate pop up window.

How to achieve this in php. The database is ready ( it wasnt tough, just two
columns added). Am even able to open the pop up window but now I want to
retrieve the remaining 2 columns. Here is the initial code :

mysql_connect(localhost,$user,$password)
;
@mysql_select_db($dbName ) or die( "Sorry But There Seems To Be A Problem
Connecting To The Database");

$query="SELECT * FROM table WHERE name = '$name' ORDER BY level ASC";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

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

$shopname=mysql_result($result,$i,"shopname");
$category=mysql_result($result,$i,"category");
$subcategory=mysql_result($result,$i,"subcategory");
$level=mysql_result($result,$i,"level");

echo "
<tr>
<td>$shopname </td>
<td>$category </td>
<td>$subcategory </td>
<td>$level </td>
<td> java script:poptastic( Details </td>
</tr>";
$i++;
}

What can be approaches to achieve this.

Many thanks in advance.

--
View this message in context: http://www.nabble.com/Ways-to-displ...6.html#a8786800
Sent from the Php - Database mailing list archive at Nabble.com.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com