<?php
//first of all we need to start the mysql connection
$dbserver = "localhost"; //almost always localhost
$dbuser = "zycron_test";
$dbpassword = "pass";
$dbname = "zycron_test";
$connect = mysql_connect($dbserver,$dbuser,$dbpassword);
mysql_select_db($dbname);
$sql = "SELECT * FROM `users` WHERE `username` = '$_POST['UID']' AND `password` = '$_POST['PWD']'";
$query = mysql_query($sql,$connect);
$count_rows = mysql_num_rows($query);
if($count_rows == 1)
{
//then this user is valid
$result_array = mysql_fetch_assoc($query);
echo "WELCOME TO THE SITE $result_array['username']!";
}
?>
that works fine (afaik), but the problem is I really don't know how to build the db. (I can create and add users to a db, but the rows & columns I don't fully get)
So, if somone could provide me with a screenshot of how I could make this script work (maybe if you could structure the db for me and show that?) any help is appreciated! thanks
p.s. sorry if this is really stupid, but I don't know how to do it..
I attached a ss of my current setup.. I'm positive it's wrong, but I tried
edit: attachment wouldn't show up.. so here's the pic: http://cheatreactor.net/misc/mysql.JPG
Edited by Zycron, 25 January 2006 - 09:45 PM.
