Re: select statement

From: Date: Thu, 05 May 2005 09:44:21 +0000
Subject: Re: select statement
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-214501@lists.php.net to get a copy of this message
On 5/5/05, Anasta <neretlis@westnet.com.au> wrote: > Why doesnt this work, it shows the username but not the balance of the users > money.here is the mysql table: > > CREATE TABLE users ( > user_id int(11) NOT NULL auto_increment, > username varchar(15) NOT NULL default '', > password varchar(15) NOT NULL default '', > status varchar(10) NOT NULL default '', > user_balance bigint(5) NOT NULL default '0', > PRIMARY KEY (user_id) > ) TYPE=MyISAM AUTO_INCREMENT=3 ; > > ///////////////////////////////////////////////////////// > <?php session_start(); > include("connect.php"); > $uname=$_SESSION['username']; > $user_balance=mysql_query($sql); > $sql = "Select FROM users ,user_balance WHERE user_id =$uname"; you should write $sql = "Select user_balance FROM users WHERE user_id =$uname"; > $result = mysql_query(); > > ?> > <?php echo $uname;?><br> > <?php echo $user_balance;?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- bala> balachandar muruganantham blog> lynx http://chandar.blogspot.com web> http://www.chennaishopping.com

« previous php.general (#214501) next »