Leone Maleash Leone Maleash - 7 months ago 9
SQL Question

my mysql doesnt working where im i wrong?

im trying to get the data from my database according to the certain id if the database.

Here are my codes below.But they are not working else

$selectquery,$resultsgetdata,$countprodu


<?php
$profrom = $_GET['id'];
$selectquery = "SELECT * FROM tbl_name WHERE proid = '$profrom'";
$resultsgetdata = mysql_query($selectquery);
$countprodu= mysql_num_rows($resultsgetdata);
if($countprodu>0)
{
$proidid = $row['proid'];
$proidName = $row['proName'];
$proidDescription = $row['proDescription'];
$Category = $row['proCategory'];
$Price = $row['Price'];
$Photo1name = $row['Photo1name'];
}

echo $proidid;
?>

Answer

your forgot to fetch the value try this

<?php
$profrom = $_GET['id'];
$selectquery = "SELECT * FROM tbl_name WHERE proid = '$profrom'";
$resultsgetdata = mysql_query($selectquery);
$countprodu= mysql_num_rows($resultsgetdata);
if($countprodu>0)
{
while($row = mysql_fetch_assoc($resultsgetdata){

$proidid = $row['proid'];
$proidName = $row['proName'];
$proidDescription = $row['proDescription'];
$Category   = $row['proCategory'];
$Price    = $row['Price'];
$Photo1name = $row['Photo1name'];
}

}


?>