I have some PHP programs that use MYSQL Databases.
I would like to display a number of information from my phpbb message board and other PHP programs on my main website page.
How would I go about doing this? Any example script would be MUCH appreciated. Anything you can help with with be great. Thanks
Obtaining and displaying info on main site page.
Moderator: General Moderators
-
camarosource
- Forum Commoner
- Posts: 77
- Joined: Sat Aug 03, 2002 10:43 pm
[php_man]mysql_fetch_array[/php_man] is a place where you would be best of starting at (that and the other links on the left side of that page).
Don't forget the usercomments on those pages also. I could post some sample code, what it would require you to read up on the functions I use in the end anyway, so pointing you to the manual seems like the better idea for now.
Have fun.
Don't forget the usercomments on those pages also. I could post some sample code, what it would require you to read up on the functions I use in the end anyway, so pointing you to the manual seems like the better idea for now.
Have fun.
-
camarosource
- Forum Commoner
- Posts: 77
- Joined: Sat Aug 03, 2002 10:43 pm
Code: Select all
<?php
// connect
$link = mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error());
// select something
$result = mysql_query("SELECT count(users) FROM bbboard.users") or die("Could not query:" . mysql_error());
// display the info
echo mysql_result($result, 0); // count()'ed users in the database
// close the connection
mysql_close($link);
?>I needed to do the exact samething and found that there was actually a phpBB mod that can help with it. Check out phpBB Fetch All