Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
include the newst member from database
Old 11-15-2005, 11:00 AM include the newst member from database
Junior Talker

Posts: 4
Trades: 0
[quote=user465]hello

i want to show who is the newst member
i have these codes but something is wrong

the table is called users where all members are saved
but it only says Our very newest member is:
and nothing more

here the codes
PHP Code:
<?php 
 
 
$dbHost 
"localhost"
$dbUser "***"
$dbPass "***"
$dbName "***"
 
$connect mysql_connect($dbHost$dbUser$dbPass) or die("Keine Verbindung zum Datenbankserver!"); 
mysql_select_db($dbName); 
 
$sql "SELECT * FROM users ORDER BY id DESC LIMIT 0, 1"
$do mysql_query($sql); 
$fetch mysql_fetch_array($do); 
 
echo 
"Our newest member is: ".$fetch['user']; 
 
?>

Last edited by user465; 11-15-2005 at 12:27 PM..
user465 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-16-2005, 01:09 PM
Ultra Talker

Posts: 251
Location: Belgium, Antwerp, Zoersel
Trades: 0
What's the error you get?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Orodreth is offline
Reply With Quote
View Public Profile Visit Orodreth's homepage!
 
Old 11-16-2005, 02:57 PM
TrentonD's Avatar
Ultra Talker

Posts: 253
Location: Calgary, Alberta, Canada
Trades: 0
I believe he is saying he doesnt get an error, rather, the lastest member simply isnt displayed =/
__________________
Signature Coming Soon! :)
Please login or register to view this content. Registration is FREE
TrentonD is offline
Reply With Quote
View Public Profile Visit TrentonD's homepage!
 
Old 11-16-2005, 03:24 PM
Junior Talker

Posts: 4
Trades: 0
thanks
the problem was user it should be username
user465 is offline
Reply With Quote
View Public Profile
 
Old 11-16-2005, 03:34 PM
Ultra Talker

Posts: 251
Location: Belgium, Antwerp, Zoersel
Trades: 0
I think you're right.

Maybe you could try to change '*' into 'user', since you don't need any other data, but I doubt it does anything. You could also try to put a ';' after your query. I don't know if it's very important for MySQL, but it never hurts.

EDIT: Nevermind, the problem was solved already.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Orodreth is offline
Reply With Quote
View Public Profile Visit Orodreth's homepage!
 
Reply     « Reply to include the newst member from database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17276 seconds with 12 queries