Jump to content

molokomesto650

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

molokomesto650's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. alright. Fixed it.....the problem was with the ajax script. Thank you all for your help.
  2. actually yes Query string: SELECT p.projName,p.comments,ep.projectid,e.employeeid FROM project p,employee_project ep,employee e WHERE ep.employeeid=p.employeeid AND ep.projectid=p.project.id AND projName = '' Returned error: Unknown column 'p.employeeid' in 'where clause' I did correct that as there really isn`t any employeeid field in the Project table. I change it to ep.projectid=p.projectid. The employee_project table links employee with project btw. So no more of that previous error but it still does not retrieve that data from database and instead the page dies.
  3. ok I tried that and I don`t have that error with the sql_num_rows function anymore. But still, can`t figure the querying. The page just die as instructed if querying fails. Very unsure how I`ve done that. Any help?
  4. sorry I forgot to add: the error I am getting is: mysql_num_rows() expects parameter 1 to be resource, boolean given in or it simply execute the die call of when num of rows <0. What I`d like is to to build and XML doc with the fields queried.
  5. Hi all. Would be very grateful if someone could help me here. I am retrieving data from my database to build up and XML document. I`m trying to get data form different tables and while the linking looks well done, I`m having problem to get the query right. Here is my database: CREATE TABLE employee ( employeeid int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, surname VARCHAR(30) NOT NULL, dob DATE NOT NULL, contact VARCHAR (7), address VARCHAR (50), rank ENUM('Employee', 'Team_leader', 'Admin') NOT NULL ); CREATE TABLE project ( projectid int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, projName VARCHAR(50) NOT NULL, dateStart DATE, comments VARCHAR(255), completed BOOLEAN ); CREATE TABLE employee_project ( employeeid int UNSIGNED NOT NULL, projectid int UNSIGNED NOT NULL, description VARCHAR(255), PRIMARY KEY (employeeid, projectid) ); CREATE TABLE task ( taskid int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, description VARCHAR(255), completed BOOLEAN ); CREATE TABLE project_task ( projectid int UNSIGNED NOT NULL, taskid int UNSIGNED NOT NULL, PRIMARY KEY (projectid, taskid) ); CREATE TABLE login ( user int NOT NULL, pass varchar(15) NOT NULL, level ENUM('Employee', 'Team_leader', 'Admin'), PRIMARY KEY (user, pass) ); And below is the querying part in the php page: $year = $_GET['txt_year']; include("db_connect.php"); $sql_select = "SELECT p.projName,p.comments,ep.projectid,e.employeeid FROM project p,employee_project ep,employee e WHERE ep.employeeid=p.employeeid AND ep.projectid=p.project.id AND projName = '$year'"; $Rs = mysql_query($sql_select); if (mysql_num_rows($Rs)<1) { mysql_close($con); die("err"); } Anybody can help? Thanks.
  6. Hi eveybody, nice forum really. Hope I can get help and help in this fine community. Still learning PHP but certainly very interested.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.