Basically I have a form that posts by the name 'group' to a PHP page that is designed to accept both posts and Gets (.php?group=") but the variable from the post is acting differently.
<?php
$username="Something";
$password="Somethingelse";
$database="Product";
mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
if (empty($_POST))
{
if (empty($_GET['group']))
{
$PID = "WM";
}
else
{
$PID = $_GET['group'];
}
}
else
{
$PID = $_POST["group"];
}
$result2 = mysql_query("SELECT * from groupy where ID='$PID'");
$Conversion = mysql_fetch_row ($result2);
?>
Basically, I can get the $PID variable to be set to the exact same value by Posting or using the .php?= method. Even though the variable, at least appears, to be the same value either way, the query functions differently depending on the origin of the $PID variable. In both cases $result2 is a valid query (returning Resource id #3) but only in the case of using the (.php?=) format of setting the $PID variable does the $Conversion variable get accurately set by the mysql_fetch_row function. If the $PID variable is set by posting and retrieved by the $_Post() function, the mysql_fetch_row function returns an empty array, which frankly is depressing on my part.
So there are no errors, but the variable is acting in two different ways via the SQL fetch row and that doesn't make sense! Is there something I don't understand about the $_POST function???