Re: Need help retreiving one record
| From: | Bossek | Date: | Wed, 07 Jan 2004 13:18:02 +0000 |
| Subject: | Re: Need help retreiving one record | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-32310@lists.php.net to get a copy of this message | ||
you have to fetch results from query
use:
mysql_fetch_field
http://si2.php.net/manual/sl/function.mysql-fetch-field.php
"Jeroen Wasteels" <jeroenwasteels@yahoo.Com> wrote in message
news:20040107014212.12378.qmail@pb1.pair.com...
> I'm studying PHP now woth this manual, but it's rather fuzzy on how to
show
> data on screen obtained from a database, or how to assign a value of one
> record of the database to a variable I can use in my script. Concrete,
this
> is the case: I would like to be able to assign to the variable
$TruePassword
> the value found in colomn Password at row $EneteredName, so I can compare
it
> to the password ppl enter when logging in.
>
> I hope this makes sense, if not please ask what I forgot to mention or
what
> I was unclear about.
>
> Thanks beforehand,
> Ondoron Bondoon
>
> btw, this is what I tried...
> <?php
> $Host="localhost";
> $Username="adminsithlore";
> $DBName="adminsithlore_uk_db";
> $Tablename="Login";
> $Connection = mysql_connect ($Host, $Username);
> $Mission= "select Password from $Tablename where (Name=\"Ondoron
> Bondoon\")";
> $Result= mysql_db_query($DBName, $Mission, $Connection);
> if ($Result) {
> print ("$Result");
> }
>
> print("<br/> $tryname, $trypassword");
> mysql_close ($Connection);
> ?>