CodeIgniter Forums
database connection with media temple - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: database connection with media temple (/showthread.php?tid=6974)



database connection with media temple - El Forum - 03-19-2008

[eluser]noussh[/eluser]
These are my configuration details in database.php.
I have a news table, i am pulling data to a my news controller. It worked fine on localhost. But when i moved to production server i am getting these errors.

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /mnt/gs01/herd02/35771/domains/noussh.com/html/system/application/config/database.php on line 55

Code:
$db['default']['hostname'] = "$_ENV['DATABASE_SERVER']";
$db['default']['username'] = " ******* ";
$db['default']['password'] = " ******* ";
$db['default']['database'] = " ******* ";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";



database connection with media temple - El Forum - 03-19-2008

[eluser]wiredesignz[/eluser]
So, which is line 55 ?

This might help:
http://www.google.com/search?hl=en&q=unexpected+T_ENCAPSED_AND_WHITESPACE&btnG=Google+Search&meta;=

But I bet its the first line, remove the quotes.


database connection with media temple - El Forum - 03-19-2008

[eluser]Glen Swinfield[/eluser]
May not be your problem bu this line:

$db['default']['hostname'] = "$_ENV['DATABASE_SERVER']";

should be:

$db['default']['hostname'] = $_ENV['DATABASE_SERVER'];

(no quotes)


database connection with media temple - El Forum - 03-19-2008

[eluser]noussh[/eluser]
@wiredesginz, line 55 was db host name $db['default']['hostname'] = "$_ENV['DATABASE_SERVER']";, yeah i did google it and i knew it's something to do with quotes.

@Glen Swinfiled, thanks man it worked.

here is the hosted link. http://www.noussh.com/news. What if i don't want my pages not cached at all. I placed $this->output->cache(0); in every controller. But still i get cached pages. Now the only solutions works for me is remove 'www' from url.


database connection with media temple - El Forum - 03-19-2008

[eluser]Glen Swinfield[/eluser]
Have you deleted the cached files? - you need to do this to stop them being called.


database connection with media temple - El Forum - 03-19-2008

[eluser]noussh[/eluser]
Yes, i deleted the cache folder. Still get the same error. Is it safe to use base url with 'www'?


database connection with media temple - El Forum - 03-30-2008

[eluser]BaRzO[/eluser]
if your server running on php 4.xx and if your local is php 5.xx you should try this open your php files make yout short type codes to long type...

find this kind of lines

$query = $this->db->select('name')->get('category')->result();

change them like this

$this->db->select('name');
$query = $this->get('category');
$result = $query->result();