Title: Undefined Variable when Variable Exists
Last modified: March 20, 2019

---

# Undefined Variable when Variable Exists

 *  [rmsgreig](https://wordpress.org/support/users/rmsgreig/)
 * (@rmsgreig)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/undefined-variable-when-variable-exists/)
 * We have inherited a wordpress website from another developer and I am having 
   issues with a plugin that was created by the previous developer (assistance from
   them is pretty much a no no), the live version of the website that is still at
   the previous host works correctly see [here](http://www.carreraslathane.co.uk/jobs/8515/Senior-Sales-Executive-/)
   but throws the following error on the development website we have migrated to:
 * Notice: Undefined variable: job in /home/sites/4b/5/52834f6c40/public_html/wp-
   content/themes/carreras/careeras/page-blank.php on line 39
 * I used kint debugger to check on job and it is returning null, the changes made
   since we transferred have been to update the database connection details and 
   to remove an undefined character from the start of the class file as it was causing
   a headers already sent error.
 * As you can see on the demo website the jobs list does show up, the problem occurs
   when trying to view a single job, does anybody have any ideas what is going wrong?
 * the query:
 *     ```
       global $wp_query;
   
       if($wp_query->get('job')){
   
       	$job = Pureblue_Cla_Integration_Public::get_single_job($wp_query->get('job'));
   
       	//	Now deal with the 'blank Industry Area'
   
       	if ($job['description']=='')$job['description']="Any Industry";
   
       }
       ```
   
 * line 39: `<p class="descr"><?php echo $job['description']?></p>`
    the function:`
   public static function get_single_job($id) {
 *  $job = ORM::for_table(‘jobs_ol’)->where(‘job_ref’, (int) $id)
    ->join(‘consultant_ol’,
   array(‘job_consult’, ‘=’, ‘consultant_ol.consult_ref’)) ->left_outer_join(‘list_2_ol’,
   array(‘job_list_2’, ‘=’, ‘list_2_ol.list_ref’)) ->find_one(); return $job;
 *  }`
    -  This topic was modified 7 years, 2 months ago by [rmsgreig](https://wordpress.org/support/users/rmsgreig/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-variable-when-variable-exists%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Minerva Infotech](https://wordpress.org/support/users/minervainfotech/)
 * (@minervainfotech)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/undefined-variable-when-variable-exists/#post-11334224)
 * Hi rmsgreig,
 * As per you code,
    if ($job[‘description’]==”)$job[‘description’]=”Any Industry”;
 * is set inside if condition. If condition doesn’t satisfy then job variable will
   not be set.

Viewing 1 replies (of 1 total)

The topic ‘Undefined Variable when Variable Exists’ is closed to new replies.

## Tags

 * [website transfer](https://wordpress.org/support/topic-tag/website-transfer/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Minerva Infotech](https://wordpress.org/support/users/minervainfotech/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/undefined-variable-when-variable-exists/#post-11334224)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
