•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,351 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,218 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 168 | Replies: 4
![]() |
•
•
Join Date: Jun 2008
Posts: 123
Reputation:
Rep Power: 0
Solved Threads: 0
Hi , I have written the code, but its giving an error,,,
Error: Could not connect to database. Please try again later.
<?php
include 'database.php';
$result = mysql_query("SELECT * FROM autoalto_contractor");
while($row = mysql_fetch_array($result))
{
echo $row['companyName'];
echo " " . $row['zipcode'];
echo " " . $row['batteryService'];
echo "<br />";
}
mysql_close();
?>
Error: Could not connect to database. Please try again later.
<?php
include 'database.php';
$result = mysql_query("SELECT * FROM autoalto_contractor");
while($row = mysql_fetch_array($result))
{
echo $row['companyName'];
echo " " . $row['zipcode'];
echo " " . $row['batteryService'];
echo "<br />";
}
mysql_close();
?>
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 240
Do you have mysql_connect and mysql_select_db in database.php ?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
age amd avatar backup blue gene breach business chips daniweb data data protection database development dos economy energy enterprise europe government hacker hardware hp ibm ibm. news intel ibm it linux medicine memory microsoft news open source openoffice pc ps3 recession red hat russia security server sql sun supercomputer supercomputing survey technology trends ubuntu working x86
- how to retrive image file from mysql databse using php (PHP)
- Displaying Images( buffered data ) from the Database using Java (Java)
- Vb.net source code to access data from Access Database (Visual Basic 4 / 5 / 6)
- vb.net code to access data from Access Database (VB.NET)
- HTML Form post to PHP? (PHP)
- Ms Access Help Please (MySQL)
Other Threads in the PHP Forum
- Previous Thread: weird characters
- Next Thread: Simple syntax error



Linear Mode