Ways to display remaining data columns.

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

 



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> javascript: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-display-remaining-data-columns.-tf3167516.html#a8786800
Sent from the Php - Database mailing list archive at Nabble.com.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux