We have our site about 40 pages build with DW CS5.5 using .PHP
I can not find any tut or treads on building a database that will let:
1. lets clients log in and edit there information, receive communication from registered employee users, submit service request, check note on requests
and
2. have a log in for employees who can register users for the first time, can search for and then view information about users, personal data, can look at all open request submitted by users and reed notes to see what has been done to complete the request for that client.
I can get a basic page going but all clients seem to see that same thing once logged in not there personal info..and i cant find anything on making the database searchable by one level not the other ( ie employee not client) and then let members see there information
Thanks in Advance everyone :D
Sorry if this seem like a nob i have not done much with database yet so im trying hard to learn ))))
06-17-2011, 04:25 PM
Nvenom
The way i display personal information is like this
Code:
<?php
$sql = "SELECT column FROM `table` WHERE `username`= '$name' ";
$result = mysql_query($sql);
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
this is of course to display images based on a mysql db value.When an account is created it adds a value of ither 0 or 1 to a column in my table. Upon loading if there account has a 0 it will show an image that says user. If it is a 1 it will show an image that says Admin and i also use the same value to allow certain things like control over an admin panel.
you may be wondering how that relates to a single account well it does it all via $name. $name is a variable for a cookie grabbed like so at the head of all my pages
of course once you go into this if you are using sessions you have to switch to checking based on cookies, i prefer cookies and im not really sure how this would work if using sessions so i cant really help you much there.
so if you are not trying to display an image and just a certain accounts information i would do it like this
Code:
<?php
$sql= "SELECT * FROM `table` WHERE `username` = '$name' ";