Here's what I know:
I know that these errors only show up on my localhost pages because I have all the error reporting on. But I want to code this correctly anyway.
I've seen the posts about using isset and I understand basically how to use it, but I'm having trouble applying it to my code when using three possible variables to the page.
At the top of my page (products.php?variable=number) I have:
<?php
$id=$_GET['id'];
$productid=$_GET['productid'];
$mfgid=$_GET['mfgid'];
for each possible type of id I have separate instructions farther down in the code:
if (isset($id)){
$queryid = "SELECT * FROM products2 WHERE products2ID=$id";
$resultid = mysql_query($queryid) or die(mysql_error());
}elseif (isset($productid)){
$queryprodid = "SELECT * FROM products2 WHERE products2ID=$productid";
}elseif (isset($mfgid)){
$querymfg = "SELECT * FROM products2 WHERE products2MfgID=$mfgid";
And at the bottom:
}else{
echo "not working";
}
I have one other undefined index in the center of my code that I don't know how to fix:
// Query table and get video file names. //
$sql = "SELECT products2Name,products2Movie FROM products2 WHERE products2ModelID=$subcat";
I'd really appreciate it if someone could tell me what I need to do to accurately test all my variables! Thanks!