Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,143 members, 7,821,896 topics. Date: Wednesday, 08 May 2024 at 09:10 PM

I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', (1232 Views)

I'm Getting "Warning: Session_start() [function.session-start]" Error. Pls Help / 500 Internal Server Error >>>>>> Pls Explain / Php Error. .Pls Help! (2) (3) (4)

(1) (Reply) (Go Down)

I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by ford705(m): 5:00pm On Sep 02, 2011
<?php

$db_host="localhost"; // Host name
$db_username="animal"; // Mysql username
$db_password="Fordile298!"; // Mysql password
$db_name="animal"; // Database name
$tbl_name="products"; // Table name

// Connect to server and select database.
function.mysql_connect($db_host, $db_username, $db_password)or die("cannot connect"; //this is the line 10

function.mysql_select_db("$db_name"winkor die("cannot select DB"wink;

?>


this works on my local machine but geves me this error online

Parse error: syntax error, unexpected '.', expecting T_STRING in /home/content/o/m/g/omgs0570/html/includes/db_conn.php on line 10



Help me urgently pls
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by ford705(m): 5:21pm On Sep 02, 2011
<?php

$db_host="localhost"; // Host name
$db_username="animal"; // Mysql username
$db_password="Fordile298!"; // Mysql password
$db_name="animal"; // Database name
$tbl_name="products"; // Table name

// Connect to server and select database.
function.mysql_connect($db_host, $db_username, $db_password)or die("cannot connect"wink; //this is the line 10

function.mysql_select_db("$db_name"winkor die("cannot select DB"wink;

?>


i need your help brothers
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by ford705(m): 5:42pm On Sep 02, 2011
Thanks;

I did it manually and it works on my system locally
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by dhtm2: 6:05pm On Sep 02, 2011
You are most certainly welcome. Sorry for my changing IDs.
Just me and seun playing pranks as usual - i am used to it.

- hasta la vista
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by divinetalent(m): 7:50pm On Sep 02, 2011
Alright, I don't like debugging people code. However, you can use this little code to connect


$server = 'localhost';
$username = '';
$password = '';
$database = '';


if(!mysql_connect($server, $username, $password)) {

exit('Fatal Error: Could not establish database connection');
}

if(!mysql_select_db($database)) {

exit('Fatal Error: Could not select the database');

}
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by dhtml7(m): 7:58pm On Sep 02, 2011
GRRRRRRRRRRRRRRRRRRRRRRRRR,

I have already solved the guys problem earlier (_werepeLeri)

Meanwhile, you appear to talk so much and you do not even know what a [size=18pt]PARSE ERROR MEANS? OLODO![/size]
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by ford705(m): 12:41pm On Sep 03, 2011
Thanks a lot fellas. It's workin on normal cpanel bought in nigeria. The main hosting was registered in london nd d cpanel is so different, the phpmyadmin is located somewhere else so, localhost will not work. What do i replace localhost wit. Thanks
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by dhtml7(m): 2:27pm On Sep 03, 2011
localhost still works on most websites. Even if it is offline.
It is the database username and password that changes.

If your server is a windows-based program.
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by DualCore1: 2:31pm On Sep 03, 2011
The sql server is on a different server from the web server. Go into cpanel and go to "mysql database" in there you should see the IP of the mysql server, replace "localhost" with that IP address. If you do not see any IP address to use. . . Check the welcome email your client received with the hosting account or contact the host service provider requesting for the IP address of the mysql server. "Localhost" only works when webserver (apache, lightppd, etc) is on the same physical server with the mysql server.
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by DualCore1: 3:37pm On Sep 03, 2011
Dear Admin,
Until you have sorted your buggy filter or seek for external help to get it sorted, I will be using text-to-image methods to make ALL the few posts I have to make on Nairaland. If that's going to piss you off end your miseries (before they start) by permanently banning me. Ford, I posted an explanation as to why localhost isn't working for you but tht was chopped off by some maliciousware.
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by DualCore1: 3:39pm On Sep 03, 2011
There you go, the push-and-start "bot" has realised its mistake.
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by ford705(m): 3:52pm On Sep 03, 2011
Finally, i fifured it out. it is not localhost but something else, Thanks to you all. you are the best from Dual core, Dhtml and you

Thank YOU!!!!!!!!!!!
Re: I Keep Getting This Error::pls Help ::parse Error: Syntax Error, Unexpected '.', by dhtml7(m): 4:56pm On Sep 03, 2011
Dual Core:

Dear Admin,
Until you have sorted your buggy filter or seek for external help to get it sorted, I will be using text-to-image methods to make ALL the few posts I have to make on Nairaland. If that's going to piss you off end your miseries (before they start) by permanently banning me. Ford, I posted an explanation as to why localhost isn't working for you but tht was chopped off by some maliciousware.
Santa Maria! That is part of what made me to be permanently banned.

The next upgrade of the nairaland spam killer will be much much better. . .

(1) (Reply)

How Important Is Alexa Ranking To Website Owners And Advertisers? / Wearobo Hits 90,000 Unique Visitors / What Can I Use To Create A Site Like Myschool.com.ng

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.