# \[PHP CLI\] Including files

**URL:** <https://forum.kirupa.com/t/php-cli-including-files/81012>\
**Category:** programming\
**Created:** [February 26, 2005, 10:28pm UTC](https://forum.kirupa.com/t/php-cli-including-files/81012 "2005-02-26T22:28:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jw06](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@jw06](https://forum.kirupa.com/u/jw06)\
**Post date:** [February 26, 2005, 10:28pm UTC](https://forum.kirupa.com/t/php-cli-including-files/81012/1 "2005-02-26T22:28:53Z")

</div>

I’m making some scripts to do some basic mysql database updates and I was wondering if I can use include and require in them. I’m including in this case, a class file. Here is the code I have so far.

```php

#!/usr/bin/php4 -q 
<?php
$dbc = mysql_connect('localhost', ' ****', '****');
$select = mysql_select_db('omniboggle');
require('../class/harvestclass.php');
if ($dbc){
	if (!$select){
		print_r(Error);
		#exit();
	}
} else {
	print_r(Error);
	#exit();
}

$query = "SELECT * FROM urls";
if ($r = mysql_query($query)) {
	while ($row = mysql_fetch_array ($r)) {
		$url = $row['url'];
		$gather = new Harvest_Keywords($url);
		$gather->process();
		print_r(Success: $url);
	}
} else {
	print_r(Error);
	exit();
}

mysql_close()
?>

```

The Error:  
Parse Error: parse error in /home/omniboggle/www/spider/supdatespider.php on line 21.

Line 21 is: $gather-\>process();

Again, this script is being run from command line and not through a web page. I’m curious if this problem could have anythign to do with maybe I cant use mysql functions in the PHP CLI? Is there a way to check if its enabled or i need to add it or something of the sort.

Thanks for the help!
