shirvo Posted November 15, 2006 Share Posted November 15, 2006 I have a database called family and in that i have a table that is called users, within that table there is ID, username, password,fname,lname,email. Now for example i want to get the data password from the username name shirvo.$name_check = $db_object->query("SELECT password FROM users WHERE username = 'shirvo'");echo $name_check;Now i thought this would do it but all it returns is "object" not the password that should be something like this "54f3e4882509eb50e344e3fc41e11924" but it doesn't so what can i do. Quote Link to comment Share on other sites More sharing options...
joshi_v Posted November 15, 2006 Share Posted November 15, 2006 Well! You are trying with q wrong query![code]<?php$name_check = $db_object->query("SELECT password FROM users WHERE username = 'shirvo'");?>[/code]It should be like this[code]<?php$name_check = mysql_query("SELECT password FROM users WHERE username = 'shirvo' ") or die (mysql_error());#Now name_check will contain the result set $res=mysql_fetch_array($name_check);echo $res['password'];?>[/code]Cheers :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.