SQL + PHP - How to?

bojanv55
07-06-2002, 08:19 AM
how to put username no 1 and username no 2 from next table

+-------------+-----------+-----------+--------------+--------+--------+
| korisniciID | username | password | email | status | jacina |
+-------------+-----------+-----------+--------------+--------+--------+
| 1 | username | password | admin@cg.yu | r | a |
| 2 | username1 | password1 | admin1@cg.yu | r | a |
+-------------+-----------+-----------+--------------+--------+--------+
2 rows in set (0.11 sec)

in arrays?

somethjing like this?


$upit = "SELECT username FROM baza_korisnici";
$rezultat1 = mysql_query($upit);
if (mysql_errno())
{
die("<BR>" . mysqlerrno() . ":" . mysql_error() . "<BR>");
}

while ($red = mysql_fetch_row($rezultat1))
{
if (mysql_errno())
{
die("<BR>" . mysqlerrno() . ":" . mysql_error() . "<BR>");
}
foreach ($red as $juzer)
{
$i = 0;
$username["$i"] = $juzer;
$i++;
}
}


??

bojanv55
07-07-2002, 08:26 AM
i found how....

Thinker
07-07-2002, 10:56 AM
I know this isn't about your question but you might want to
consider using the encryption function for your password field.
Encrypt the password before storing, and when you need to
authenticate someone, run their entered password through the
same function, and compare to the stored value.

bojanv55
07-08-2002, 08:36 AM
yes, i encrypted my passwords. but do you know any way how to authorizate? i made 1st autorization page, but when i type password, i enter the page news.php. But if i enter http://localhost/admin/news.php, i can access that page without autentification. How ti change that?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum