Garcia Posted October 20, 2007 Share Posted October 20, 2007 Ok this is what I did: Under projects table, projectclients will be assigned an email that needs to match the email of the client to display the project. But that is what I am having problems with. Here is the client.php page. <?php session_start(); header("Cache-control: no-cache"); require ('config.php'); $sql ='SELECT email FROM user'; $rs = @mysql_query($sql, $con); $row = mysql_fetch_assoc($rs); $sql2 ='SELECT projectclient FROM project'; $rs2 = @mysql_query($sql, $con); $row2 = mysql_fetch_assoc($rs2); $email = $row['email']; $projectclient = $row['projectclient']; if($_SESSION['email']){ print " Welcome "; print $_SESSION['email']; } else { header ("Location:login.php"); exit(); } if($email == $projectclient) { print " You have a project. "; } else { print "Umm no project"; } ?> t displays umm no project even when I assigned that project to that email... Quote Link to comment https://forums.phpfreaks.com/topic/74072-project-display-problem/ Share on other sites More sharing options...
Orio Posted October 20, 2007 Share Posted October 20, 2007 I didn't really understand what you want to script to do, but I'll tell you what it does do: It takes the first email (from the first row) from the "user" table, and checks if it is the same as the email in the first row in the table "project". Obviously, you are missing something in your sql query- I don't think you want to compare the first rows in these tables, it has to do something with the currently logged user right? You are missing a "WHERE" in your sql somewhere. Orio. Quote Link to comment https://forums.phpfreaks.com/topic/74072-project-display-problem/#findComment-373947 Share on other sites More sharing options...
Garcia Posted October 20, 2007 Author Share Posted October 20, 2007 What I am trying to do is this. Admin adds a project for a specific client (projectclient).The client goes to the client page to view his project, project only appears if the client email matches the one the admin set (projectclient). Make sense? I am still trying to figure out how to do this. Quote Link to comment https://forums.phpfreaks.com/topic/74072-project-display-problem/#findComment-374067 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.