i have try to query data from mysql but found a lot of problem here.
database = khai
table = writers
column = nameID, name, address, phone
this is my codes (below)
<?
function db_connect()
{
$result = @mysql_pconnect("localhost", "khai", "password");
if (!$result)
return false;
if (!@mysql_select_db("khai"))
return false;
return $result;
}
function get_story_record($name1)
{
$conn = db_connect();
$sql = "select * from writers";
$result = mysql_query($sql, $conn);
return(mysql_fetch_array($result));
}
if (isset($writers))
$s = get_story_record($name1);
echo "<tr>";
echo "<td>";
echo $s[name1];
echo "</td>";
echo "<td>";
echo $s[address];
echo "</td>";
echo "<td>";
echo $s[phone];
echo "</td>";
?>
I am trying to retrieve records using spesific row ID, which the page should be like this
khai.php?nameID=1
--------------------------------then display
Name Address phone
blalal blalalal blalalala
anyone please help me on this..thanx in advance.