Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 7th, 2005, 03:37 AM
Authorized User
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to knight
Default combo box insted of hyper link

look at code below

include 'config.php';
include 'opendb.php';

$query = "SELECT id, name FROM upload";
$result = mysql_query($query) or die('Error, query failed');
if(mysql_num_rows($result) == 0)
echo "Database is empty <br>";
while(list($id, $name) = mysql_fetch_array($result))
<a href="download.php?id=<?php echo $id;?>"><?php echo $name;?></a> <br>

i want to use combo or menu/list insted of hyper link what can i do
please hel me
infact i want to select a field form database then fit into a combo box then i use selected id to view all information related to selected
any idea???

Old February 9th, 2005, 11:15 AM
Authorized User
Join Date: Jul 2004
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rajuru Send a message via Yahoo to rajuru

so far I know, you may be needed to user javascript.
You have to make a mix of PHP & javascript to do this.

PHP is needed to retrieve link from database and Javascript to follow the link when you select any item in the combo/list box

sorry for no specific help

Best Regard:
Md. Zakir Hossain (Raju)
Old March 29th, 2005, 08:45 AM
Registered User
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to dBaser

        $k=mysql_query("select * from $content_table ORDER BY id DESC");

    while ($i< mysql_numrows($k))
        $z = mysql_fetch_array($k);
        if ($z[isshow] == 1) $content.="<a href=\"$PHP_SELF?op=mdload&name=$content_table&fil e=index&read=$z[id]\">".stripslashes($z[title])."</a>\n<br>\n";


echo ("<form action=admin.php method=post>");
echo "<select name=aid>";
$result = $db->sql_query("select uid, uname from webze_users where user_level='1'");
if (!$result) {
echo $langx[SQLERROR];
while (list($uid, $uname)=$db->sql_fetchrow($result)) {
echo "<option value=$uid>$uname</option>";
echo "</select>;
echo "</form>";

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
Combo box choice creating filtered combo box stevensj5 Access 11 September 13th, 2007 11:33 AM
hyper link to gridview samir_katore .NET Framework 2.0 6 August 20th, 2006 10:38 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.