4 Replies Latest reply on Oct 22, 2008 3:04 AM by (Purple_Edge)

    Update/Delete

      I have a customer and jobs system where the customer logs in and can add/edit/delete a job they have posted.

      Now I have been able to add a job without any problems. But the rest_id is not getting passed so that it adds the job to the correct restaurant.

      How can I pass the value of the logged in user's restaurant_id so that it will add it to the correct restaurant and update and delete the job too.

      I want the job's data to only show the title and category. and edit/delete on the side.

      I am using Dreamweaver Development Toolbox but its very confusing and not giving me the same result. It added the job, but it made rest_id "0"

      Any ideas?

      -- Table structure for table `jobs`
      --

      CREATE TABLE IF NOT EXISTS `jobs` (
      `job_id` int(6) NOT NULL auto_increment,
      `job_title` varchar(50) NOT NULL,
      `job_term` varchar(20) NOT NULL,
      `job_category` varchar(20) NOT NULL,
      `job_description` longtext NOT NULL,
      `job_start_date` varchar(8) NOT NULL,
      `job_wages` varchar(10) NOT NULL,
      `job_accom` varchar(8) NOT NULL,
      `job_travel` varchar(20) NOT NULL,
      `job_drvlicense` varchar(10) NOT NULL,
      `job_holpay` varchar(25) NOT NULL,
      `job_status` varchar(10) NOT NULL,
      `rest_id` int(6) NOT NULL,
      PRIMARY KEY (`job_id`),
      KEY `rest_id` (`rest_id`),
      FULLTEXT KEY `job_title` (`job_title`,`job_category`,`job_description`,`job_start_date`,`job_status`),
      FULLTEXT KEY `job_term` (`job_term`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

      - Table structure for table `restaurants`
      --

      CREATE TABLE IF NOT EXISTS `restaurants` (
      `rest_id` int(6) NOT NULL auto_increment,
      `rest_name` varchar(25) NOT NULL,
      `rest_address` varchar(30) NOT NULL,
      `rest_area` varchar(30) NOT NULL,
      `rest_city` varchar(25) NOT NULL,
      `rest_postcode` varchar(8) NOT NULL,
      `rest_teleno` varchar(12) NOT NULL,
      `rest_fax` varchar(13) default NULL,
      `rest_email` varchar(80) NOT NULL,
      `rest_website` varchar(80) default NULL,
      `rest_opentimes` varchar(255) default NULL,
      `rest_description` longtext,
      `rest_logo` varchar(255) default NULL,
      `rest_photo` varchar(255) default NULL,
      `rest_contact` varchar(50) NOT NULL,
      `rest_contpos` varchar(10) NOT NULL,
      `rest_conttel` varchar(13) NOT NULL,
      `rest_licenced` varchar(3) default NULL,
      `rest_capacity` varchar(10) default NULL,
      `rest_havesite` varchar(3) default NULL,
      `rest_username` varchar(15) default NULL,
      `rest_password` varchar(8) default NULL,
      `rest_status` varchar(10) NOT NULL default 'OFF',
      PRIMARY KEY (`rest_id`),
      FULLTEXT KEY `rest_name` (`rest_name`,`rest_address`,`rest_city`,`rest_postcode`,`rest_teleno`,`rest_email`,`rest_ website`,`rest_opentimes`,`rest_description`,`rest_photo`,`rest_contact`,`rest_status`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

      --

      login.php .....