Danny
October 26th, 2007, 16:03
Hi All,
I am trying to transfer an already coded database from one site:
http://www.mmia.org.uk/companydb/index.php?id=16
onto its redesigned site here:
http://mmia.org.uk/prototype/members/members.php
The code to select which of the db entries to view is:
<a href="members.php?id=46"> Where the id="x" is the entry no.
Then the members.php page should display the entry using this code:
<?php
include 'dbconnect.php';
$id = is_numeric($_GET['id'])?$_GET['id']:1;
$get = mysql_query("SELECT * FROM coname where ID = $id") or die("Mmm pie:" . mysql_error());
while ($row = mysql_fetch_row($get)) {
echo "<img style=\"float: left; padding: 2px;\" src=".$row[1]."><br><br><br><br>";
echo "<br><h2>".$row[2]."</h2><br>";
echo "<strong>Address: </strong><br>".$row[3]."";
echo "<br>".$row[4]."";
echo "<br>".$row[5]."";
echo "<br><br><strong>Postcode:<br></strong> ".$row[6]."";
echo "<br><br><strong>Phone Number:<br></strong>".$row[7]."";
echo "<br><br><strong>Email Address:</strong><br><a href='mailto:".$row[8]."'>".$row[8]."</a>";
echo "<br><br><a href=".$row[9].">".$row[9]."</a>";
echo "<br><br><strong>Contact</strong><br>".$row[11]."";
}
?>
But it doesnt?
The database works on the current site - and its all on the same server etc.
Any Ideas?
Danny
I am trying to transfer an already coded database from one site:
http://www.mmia.org.uk/companydb/index.php?id=16
onto its redesigned site here:
http://mmia.org.uk/prototype/members/members.php
The code to select which of the db entries to view is:
<a href="members.php?id=46"> Where the id="x" is the entry no.
Then the members.php page should display the entry using this code:
<?php
include 'dbconnect.php';
$id = is_numeric($_GET['id'])?$_GET['id']:1;
$get = mysql_query("SELECT * FROM coname where ID = $id") or die("Mmm pie:" . mysql_error());
while ($row = mysql_fetch_row($get)) {
echo "<img style=\"float: left; padding: 2px;\" src=".$row[1]."><br><br><br><br>";
echo "<br><h2>".$row[2]."</h2><br>";
echo "<strong>Address: </strong><br>".$row[3]."";
echo "<br>".$row[4]."";
echo "<br>".$row[5]."";
echo "<br><br><strong>Postcode:<br></strong> ".$row[6]."";
echo "<br><br><strong>Phone Number:<br></strong>".$row[7]."";
echo "<br><br><strong>Email Address:</strong><br><a href='mailto:".$row[8]."'>".$row[8]."</a>";
echo "<br><br><a href=".$row[9].">".$row[9]."</a>";
echo "<br><br><strong>Contact</strong><br>".$row[11]."";
}
?>
But it doesnt?
The database works on the current site - and its all on the same server etc.
Any Ideas?
Danny