Greetings;
As the title suggests I’m having a problem with my PHP code. I have two tables: seller and category.
Seller has: id, category_id, name and description.
Category has: id,name and description.
I wrote a code that would send the seller’s id to the seller’s page so I can write the seller’s information:
[code=php]<?php
$qry = ‘SELECT * FROM seller WHERE category_id=’.$_GET[‘categoryId’].’;’;
$result = mysql_query($qry);
while ($row = mysql_fetch_array($result)){
Print ‘<tr>’;
Print ‘<td style=”width:15%”><a href = “Seller_page.php?sellerId =’.$row[‘id’].'”>’;
Print ‘<img src = “Seller_Image_table.png” height = “50” width = “50”></a></td>’;
Print ‘<td style=”width:50%”><span class=”tableText”>’ .$row[‘name’].'</span><br/> ‘;
Print ‘<span class = “cellText”>’.$row[‘description’].'</span></td>’;
Print ‘</tr>’;
}
?>
In the seller’s page I wrote this code:
[code=php]<?php
$val = $_GET[‘sellerId’];
$qry1 = ‘SELECT * FROM seller WHERE id =”$val”‘;
$result1 = mysql_query ($qry1);
while ($row1 = mysql_fetch_array($result1)){
Print ‘<span style = “font-family:tahoma; font-size:22; font-weight:bold”>’.$row1[‘name’].'</div><br/>’;
}
?>
But I get this error:
Notice: Undefined index: sellerId in C:xampphtdocsSeller_page.php on line 39.
I’m not sure what the problem is.
Thanks in advance.