Current location: Hot Scripts Forums » Programming Languages » PHP » show data from record problem


show data from record problem

Reply
  #1 (permalink)  
Old 02-03-04, 12:19 AM
Paladine Paladine is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
show data from record problem

First hi to all, it's my first post

my problem is this:

i nedd to show the username and leveluser in the web, i try using the server behaviour in dw mx 2004 with the option dinamic text in a text box, but only shows the first register in the db, can any help me plz.


i'm using dw mx 2004, mysql and php last versions, running under apache in win xp.




PD: sorry for my bad english, i talh spanish
Reply With Quote
  #2 (permalink)  
Old 02-03-04, 12:38 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
I think the query you are using has the : 'LIMIT 1' .. if so, just omit it ..

if not, please show your code so we can help..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 02-03-04, 12:44 AM
Paladine Paladine is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
i don't find that, here is the code for show the data



<table width="200" border="0">
<tr>
<td>&nbsp;</td>
<td><form name="form1" method="post" action="">
<input name="textfield" type="text" value="<?php echo ucfirst($row_Recordset1['Nick']); ?>">
</form></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><form name="form2" method="post" action="">
<input name="textfield2" type="text" value="<?php echo ucfirst($row_Recordset1['Categoria']); ?>">
</form></td>


i hope that help
Reply With Quote
  #4 (permalink)  
Old 02-03-04, 12:59 AM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hello there,

Hace tres anos que estudio espanol en mi escuela pero no puedo hablarla muy bien...

Anyways, I suppose $row_Recordset1 is an array that you fetched your query result into (e.g. something like $row_Recordset1 = mysql_fetch_assoc($result)). If so, you need to fetch as many times as you want - or until there is no more row to fetch.

You can loop through the result - while loop is a popular one for this particular purpose:

PHP Code:

<?php


// Assuming $result is the query result that contains more than one rows.

// While you can fetch the result's next row into this array...
while ($row_Recordset1 mysql_fetch_assoc($result)) {
    
// Your statements here.
    // For instance, if you wanted to show all "Nick" fields in a <td></td>, do this:
    
echo '<td>'.$row_Recordset1['Nick'].'</td>';
}

?>
I see you are echoing the field values into textboxes, but the same logic applies here, too.

Hope this helps.
__________________
Blavv =|
Reply With Quote
  #5 (permalink)  
Old 02-03-04, 01:02 AM
Paladine Paladine is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
but that will shows me all the "nicks" of the table or just the nick of the logged user?
because y need the logged user only
Reply With Quote
  #6 (permalink)  
Old 02-03-04, 01:05 AM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Oh that was fast. =)

The one I gave you above will show all the "Nick" s that have been returned from the database (i.e. whatever "Nick" s that the $result contains). So if your query is such that it returns all the logged-in users, yes, it will show all the logged-in users. But if not, then no.

Good luck.
__________________
Blavv =|
Reply With Quote
  #7 (permalink)  
Old 02-03-04, 01:09 AM
Paladine Paladine is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
hehehe, i say the same when receive the email notification of reply


the proble is that i need to show to the user something like "welcome (nick), you are (categoria) in the web" , because there are restrcited areas according to the user level and i want the users know his own level
Reply With Quote
  #8 (permalink)  
Old 02-03-04, 01:06 PM
dD|Fusion dD|Fusion is offline
Newbie Coder
 
Join Date: Jan 2004
Location: Brazil
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
if i really got what you mean i think you should use some condicionals to make that...

PS: do you speak portuguese?


100+
__________________
"O google é meu pastor e nada me faltará!"
http://www.25-design.com
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem getting data from DataGrid on update petersza ASP.NET 5 10-19-04 11:37 PM
detail data, with next previous record ivan PHP 2 12-30-03 06:40 PM
Tab Problem!!! menwa Everything Java 0 12-06-03 05:53 AM
Print data by date perleo PHP 2 08-09-03 09:35 AM


All times are GMT -5. The time now is 08:15 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.