Excuse me skipping the 'proper' quoting... (I'm *** )
Man this is confusing! I've changed my PHP script to add $_POST, but I'm still not getting any output. Have I styled the $_POST and SELECT lines correctly?
*** Firstly, "style" isn't the right word. You don't 'style' bits of program - this is not the half-baked world of CSS. You have to write a bit of php to be syntactically correct, and with the semantics specified in the manual (which is very good, btw:
http://www.php.net/manual/en/ )
<?php
$con = mysql_connect("localhost","userid","name");
if (!$con)
{
die('Could not connect to it: ' . mysql_error());
}
mysql_select_db("MyDatabase", $con);
$state=$_POST['state']
*** Missing a semicolon. But this is the point to find out what's going on by _debugging_. Add echo "<br>State: $state\n"; to see what value is being passed. Then you know whether the problem is upstream or downstream of this point.
$result = mysql_query("SELECT * From MyTable Where CompanyState = $state ");
while ($row = mysql_fetch_array($result))
$CompanyName = $row["CompanyName"];
$ContactFirstName = $row["ContactFirstName"];
$ContactLastName = $row["ContactLastName"];
$CompanyStreetAddress = $row["CompanyStreetAddress"];
$CompanyCity = $row["CompanyCity"];
$CompantState = $row["CompanyState"];
$CompanyZip = $row["CompanyZip"];
$CompanyPhone = $row["CompanyPhone"];
$ComapnyFax = $row["CompanyFax"];
$CompanyEmail = $row["CompanyEmail"];
$CompanyWebsite = $row["CompanyWebsite"];
$CompanyAreaServed = $row["CompanyAreaServed"];
echo "$CompanyName<br>$ContactFirstName<br>$ContactLastName <br>$CompanyStreetAddress <br>$CompanyCity <br>$CompantState <br>$CompanyZip <br>$CompanyPhone <br>$ComapnyFax <br>$CompanyEmail <br>$CompanyWebsite <br>$CompanyAreaServed ";
mysql_close($con);
*** Offhand I can't see the problem. What actually happens?