I am having a similar problem.
I am trying to learn the combo of PHP and MySQL. A successful PHP file with a hard-wired search query works fine when loaded in the browser:
$result = mysql_query (‘select client.firstname, client.lastname, reoptxfr.casetype, reoptxfr.datefield, reoptxfr.closedon from client, reoptxfr WHERE client.assignedworkerslastname = ‘hunter, allan’ and client.statusofcase = ‘1 Active Case’ and client.clientid = reoptxfr.clientid order by client.lastname, client.firstname, reoptxfr.sequencenumber’);
… but the current short-term goal is to start off with a page in which the user would TYPE IN the case worker’s last name and click the submit button which would POST that input from the input form and then have the PHP page pick up on the value passed to it and incorporate it into the query.
Well, this doesn’t work. (It should give you a fairly concrete notion of what I’m trying to do, though…
[noparse]
input = _POST [‘msg’];
$result = mysql_query (‘select client.firstname, client.lastname, reoptxfr.casetype, reoptxfr.datefield, reoptxfr.closedon from client, reoptxfr WHERE client.assignedworkerslastname = $input and client.statusofcase = ‘1 Active Case’ and client.clientid = reoptxfr.clientid order by client.lastname, client.firstname, reoptxfr.sequencenumber’);[/noparse]
The “submit form” is a very simple bit of HTML:
[noparse]
<html>
<head></head>
<body>
<form action=“nextsqlphp.php” method=“post”>
Enter your message: <input type=“text” name=“msg” size=“30”>
<input type=“submit” value=“Send”>
</form>
</body>
</html>
[/noparse]
Anyone know how to pass a param from an initial web page screen to the PHP on the next so that the target page’s PHP will use the value handed off to it in a search query?