Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem publishing PHP and mySQL to the live site

Status
Not open for further replies.

sbayter

IS-IT--Management
Joined
Nov 14, 2002
Messages
95
Location
CO
Hi,
I was working in a php application with mySQL and I was testing it locally before posting it in the live site. In my computer it was working perfect but when I posted the db and the page it give me this error:
"No Database Selected"

The database in in mysql folder and the pages are in the html folder.

I think this could be in the connections page which looks like this:
<?php
# FileName=&quot;Connection_php_mysql.htm&quot;
# Type=&quot;MYSQL&quot;
# HTTP=&quot;true&quot;
$hostname_survey = &quot;localhost&quot;;
$database_survey = &quot;Survey1&quot;;
$username_survey = &quot;&quot;;
$password_survey = &quot;&quot;;
$survey = mysql_pconnect($hostname_survey, $username_survey, $password_survey) or die(mysql_error());
?>

Any idea what this could be?
Thanks,
sbayter
 
Add in a
[tt]mysql_select_db($database_survey) or die(&quot;Couldn't select database: &quot; . mysql_error());[/tt]
at the end of that. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top