grebud
04-11-2012, 09:03 AM
Hello, I have this code that takes the id and send it to the showFullArticle.php:
$rs_result = mysql_query ($sql,$mysql_connection);
while ($row = mysql_fetch_assoc($rs_result)) {
?>
<div><a href="showFullArticle.php?id=<?php echo $row["id"];?>" target="Article">
<?php echo $row['title']; ?></a>
</div>
<div class="description"><?php echo $row["description"];?></div>
<?php
};
?>
I put that code in the showFullArticle.php file:
<?php
$id = $_GET["id"];
echo $id;
$mysql_connection = mysql_connect("host", "user", "password") or die ('Eror: ' .mysql_error());
$database_myconnection = "database";
$query = "select * from tablename where id = '".$id."'";
if (mysql_query($query)) {
echo "
'".$title."'
";
}
mysql_close($mysql_connection);
?>
but something is wrong. mysql data are not displayed. Can you please help me? Thank you in advance!
$rs_result = mysql_query ($sql,$mysql_connection);
while ($row = mysql_fetch_assoc($rs_result)) {
?>
<div><a href="showFullArticle.php?id=<?php echo $row["id"];?>" target="Article">
<?php echo $row['title']; ?></a>
</div>
<div class="description"><?php echo $row["description"];?></div>
<?php
};
?>
I put that code in the showFullArticle.php file:
<?php
$id = $_GET["id"];
echo $id;
$mysql_connection = mysql_connect("host", "user", "password") or die ('Eror: ' .mysql_error());
$database_myconnection = "database";
$query = "select * from tablename where id = '".$id."'";
if (mysql_query($query)) {
echo "
'".$title."'
";
}
mysql_close($mysql_connection);
?>
but something is wrong. mysql data are not displayed. Can you please help me? Thank you in advance!