PDA

View Full Version : Simple(ish) Help



Naythi.
07-10-2008, 08:31 AM
So i've got a database with 'username, password, email & currency'.
Im a PHP noob i admit that, but im looking for a little help.

I want to show on my page, the 'currency' from the 'username' that is currently logged in if you get me? Somebody fancy giving a Noob a head in the right direction.

Invent
11-10-2008, 05:29 PM
Sorry for the delay :)

Try this but changing the table name and $username variable of course..



<?php

$query = mysql_query( "SELECT `currency` FROM `table_name` WHERE `username` = '" . $username . "'" );

$fetch = mysql_fetch_assoc( $query );

echo $fetch[ 'currency' ];

?>

Want to hide these adverts? Register an account for free!