harlequin2k5
05-21-2006, 09:56 PM
all that I want to do is output my list of board members from a mysql table
this is the last piece of code I've tried to work with - all taken from the php manual (from php.net) as well as another php/mysql book that I have
<?php require_once("functionlist.php");?>
<?php
$query = 'SELECT * FROM `board`';
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
echo $row['boardmemberid'];
echo $row['boardmembertitle'];
echo $row['boardmembername'];
echo $row['boardmemberterm'];
echo $row['boardmemberelection'];
}
mysql_free_result($result);
?>
this is my functionlist
// Connect to DB
function doconnect()
{
$dbhost = '127.0.0.1:3306';
$dbuser = '*';
$dbpass = '*';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to MySQL');
$dbname = 'suncoastusbcba_org_-_association';
mysql_select_db($dbname, $conn) or die ('Error finding database');
return $conn;
}
all of this is supposed to display in a list (I'll worry about formatting it later) on this page (http://test.suncoastusbcba.org/board.php)
I know how easy this is but this is the first time I'm actually making my own query with php...
EDIT: I may need a bump to MySQL - sorry for the mispost
this is the last piece of code I've tried to work with - all taken from the php manual (from php.net) as well as another php/mysql book that I have
<?php require_once("functionlist.php");?>
<?php
$query = 'SELECT * FROM `board`';
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
echo $row['boardmemberid'];
echo $row['boardmembertitle'];
echo $row['boardmembername'];
echo $row['boardmemberterm'];
echo $row['boardmemberelection'];
}
mysql_free_result($result);
?>
this is my functionlist
// Connect to DB
function doconnect()
{
$dbhost = '127.0.0.1:3306';
$dbuser = '*';
$dbpass = '*';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to MySQL');
$dbname = 'suncoastusbcba_org_-_association';
mysql_select_db($dbname, $conn) or die ('Error finding database');
return $conn;
}
all of this is supposed to display in a list (I'll worry about formatting it later) on this page (http://test.suncoastusbcba.org/board.php)
I know how easy this is but this is the first time I'm actually making my own query with php...
EDIT: I may need a bump to MySQL - sorry for the mispost