Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
PHP INCLUDE(); problem

Reply  
Thread Tools
alex_sandro's Avatar
Junior Member with 20 posts.
 
Join Date: Aug 2009
Experience: Intermediate
02-Feb-2010, 11:48 AM #1
PHP INCLUDE(); problem
Hello people, here is my another problem

At the beginning of the script I have some values assigned to some variables and the script works perfectly.

Code:
$host='localhost';
$username='username';
$password='password';
$db_name='dbname';
$tbl_name="table";
so I created new file with the name incl.php which contains only this part of my script and in the main file I worte require ("incl.php");
and now I get the following error:

$host='localhost'; $username='username'; $password='password'; $db_name='dbname'; $tbl_name="table"; Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Program Files\VertrigoServ\www\icsp2\process.php on line 6
cannot connect to database

ehymel's Avatar
Senior Member with 660 posts.
 
Join Date: Aug 2007
Location: Texas
02-Feb-2010, 02:14 PM #2
Don't forget that you need the <?php in your include file before any php code so gets interpreted properly. Otherwise anything in the include file will be handled as html plain text.
Mr.LLB's Avatar
Member with 289 posts.
 
Join Date: May 2008
Location: Toronto, Ontario
Experience: Advanced
05-Feb-2010, 02:49 PM #3
i think the problem is that the database you are trying to connect to does not require a password.
the password field is set to off in the database settings. this is the default option for mysql databases. so go into it and look at your database and first give it a password.
__________________
<?php $h="Hello "; $w=" World"; echo $h.$w; ?>
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:33 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.