I repeat: http://forums.digitalpoint.com/showpost.php?p=4411685&postcount=6 And you're not actually fetching the row. Have a look at http://www.php.net/mysql_fetch_array
Ok, I fixed the double quotes.... I read that article on real_escape_string a couple of hours back, I didn't understand. Can you please explain? BTW: How to use quotes in php? Isn't it like /" or something?
<? session_start(); //Check to make sure they're logged in. include 'check.php'; //Include the config panel into the page. include 'config.php'; //Get on with the page echo "Welcome, $username"; mysql_connect($server, $db_user, $db_pass)or die ($theError); mysql_select_db($database)or die ($theError); $query = mysql_query("select balance from `users` where `username`= '" .mysql_real_escape_string($username) . "' LIMIT 1")or die($theError); $userinfo = mysql_fetch_array($query); echo 'You currently have a balance of ' . $userinfo['balance']; ?> PHP:
I see Nico posted working code for you, but I did provide a working version of this earlier in the thread : http://forums.digitalpoint.com/showpost.php?p=4419774&postcount=9
Thanks everyone!! Usually I'd say I'll try it out in the morning, but right now I can't wait so I'll try it out right now Edit: Yippeee!! Its working! Thanks for all the help everyone!
yes, you can do this by writing the statement mysql_query("Select col1, col2, col3, clo4 from table name where col1='your selection'"); Try this to select multiple column. you can also do by this method:- mysql_query("Select * from table name where col1='your selection'");