•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 402,021 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 2,436 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.
Views: 1163 | Replies: 3
![]() |
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
you can do it in php . Here is the code i use to show a report of all the people whose email adresses and names i have in my database
dbinfo.inc should contain something like:
<html>
<head>
<title>Test MYSQL PHP Page</title>
</head>
<body>
<?php
include("dbinfo.inc.php");
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><u><center>Database Output</center></u></b><br>";
echo "<hr>";
$i=0;
while ($i < $num) {
$first=mysql_result($result,$i,"first");
$last=mysql_result($result,$i,"last");
$email=mysql_result($result,$i,"email");
echo "<b>$first $last</b><br>$email<br><hr><br>";
$i++;
}
?>
<p>
<center><a href="/index.php">Return to main page</a></center>
</p>
</body>
</html>
dbinfo.inc should contain something like:
<?php $user="root"; $password="letmein"; $database="mydatabase"; ?>
Last edited by jbennet : Mar 28th, 2007 at 6:26 am.
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 268
yes there is but thats not my speciality, sorry
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- how to show OLAP Reports in Crystal Reports in a ASP Page with Drill down option (ASP)
- Freelance Developer ASP.NET / VB.NET / C# / VB / ASP & Crystal Reports (Web Development Job Offers)
- Migration from SQL Server Reporting Services to Oracle Reports 10g (Oracle)
- Create Graphical reports in Ms Word Using Code from VB6 (Visual Basic 4 / 5 / 6)
- Need Some Help Regarding Crystal Reports (ASP.NET)
- Team Lead C#, ASP.NET, VB.NET, Web Services, SQL - Los Angeles, CA (Web Development Job Offers)
Other Threads in the MySQL Forum
- Previous Thread: help required mysql+jsp
- Next Thread: new to MYSQL need help



Linear Mode