Problem with "while {"

This is a discussion on "Problem with "while {"" within the PHP Forum section. This forum, and the thread "Problem with "while {" are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 30th, 2006, 09:43
Junior Member
Join Date: Nov 2006
Location: London
Age: 22
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with "while {"

EDIT: The problem is with the a link... when i remove this it works. Can someone explain why this happens please

PHP: Select all

function selectgroup($id) {
    global 
$dbc;
    echo 
'<p>Select Group</p>';
    
$query "SELECT group_id, group_name, group_description FROM uncgroupss";
        
$result mysql_query ($query); 
        while (
$row mysql_fetch_assoc ($result)) {
            
$groupid $row['group_id'];
            echo 
'<table><tr><td>'$row['group_name'] . ' - ' $row['group_description'] . ' - <a href="admin_members.php?action=insert&id='.$id.'&group='.$groupid.'>Add User</a></td></tr></table>';
        }
    } 
The query works fine and when inserted directly into mysql it brings back 2 results. When i run it in my webpage it only brings back one result.

Can anyone see anything wrong with this?

Last edited by Perad; Nov 30th, 2006 at 10:28.
Reply With Quote

  #2 (permalink)  
Old Nov 30th, 2006, 16:29
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problem with "while {"

Code: Select all
 ' - <a href="admin_members.php?action=insert&id='.$id.'&group='.$groupid.'">
Reply With Quote
Reply

Tags
php while

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a "tag" system to find relevant "related" pages MrQuestions PHP Forum 3 Mar 20th, 2008 23:06
[SOLVED] Show "Image" Depends On User "Status"? Monie Classic ASP 6 Oct 16th, 2007 01:22
? IS "meta name="robots" content="?" necessary in pages ? Love2Java Starting Out 6 Aug 8th, 2007 13:48
window.opener.document["nameForm"].getElementById("someid").value; doesnt work drpompeii JavaScript Forum 0 Feb 17th, 2007 23:09
<option value="yes" class="x"> problem in Firefox mameha1977 Web Page Design 1 Jun 21st, 2006 11:20


All times are GMT. The time now is 05:31.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43