[PHP]<?php
error_reporting (E_ALL);
ini_set('displa y_errors', '1');
include '../../db.inc';
$id = intval( mysql_real_esca pe_string( $_GET['id'] ));
//echo "id = $id";
// Connect to server and select database.
$sql="SELECT name,link FROM $tbl_name where contentid = '$id'";
$result=mysql_q uery($sql);
?>
<table width="180" border="0" cellspacing="1" cellpadding="0" >
<tr>
<td>
<table width="170" border="0" cellspacing="0" cellpadding="1" >
<tr>
</tr>
<tr>
</tr>
<?php
while($rows=mys ql_fetch_array( $result)){
?>
<tr>
<td><? echo $rows['name']; ?></td>
<td><? echo $rows['link']; ?></td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
<td align="center"> <a href="update_do c.php?id=<? echo $id;?>">update</a></td>
<td align="center"> <a href="delete_do c.php?id=<? echo $id;?>">delete</a></td>
<td align="center"> <a href="insert_do c.php?id=<? echo $id;?>">insert</a></td>
<?php
mysql_close();
?>[/PHP]
And my update_doc.php is also very beautiful, attractive.
[PHP]<?php
error_reporting (E_ALL);
ini_set('displa y_errors', '1');
include '../../db.inc';
$tbl_name="jos_ documentation"; // Table name
// Connect to server and select database.
//mysql_connect(" $host", "$username" , "$password" )or die("cannot connect");
//mysql_select_db ("$db_name") or die("cannot select DB");
// get value of id that sent from address bar
$id=$_GET['id'];
// Retrieve data from database
$sql="SELECT name,link FROM $tbl_name WHERE contentid='$id' ";
$result=mysql_q uery($sql);
$rows=mysql_fet ch_array($resul t);
?>
<table width="400" border="0" cellspacing="1" cellpadding="0" >
<tr>
<form name="form1" method="get" action="update_ ac.php">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0" >
<tr>
<td> </td>
<td colspan="3"><st rong>Update Main Issues</strong> </td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> <strong>Name</strong></td>
</tr>
<tr>
<td> </td>
<td align="center"> <input name="name" type="text" value="<? echo"$rows[name]"; ?>" size="30" /></td>
<td align="center"> <input name="name" type="text" value="<? echo"$rows[link]"; ?>" size="30" /></td>
</label></td>
</tr>
<tr>
<td> </td>
<td><input name="id" type="hidden" id="id" value="<? echo $rows['contentid']; ?>"></td>
<td align="center"> <input type="submit" name="Submit" value="Submit"> </td>
<td> </td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<?
// close connection
mysql_close();
?>[/PHP]
Problem is that it will only give me the first set of data, name link.
And I'm guessing it should be a petty thing that I have either a) not done or b) done wrong.
Can anyone of you point me in the right direction?
when I do an:
[PHP]SELECT name,link from table where contentid='13'[/PHP] I get two lines of results, instead of only one.
Thank's in advance for all help!
Phopman