• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

QUESTION Insert user input into snippet

dmcgetti

New member
Messages
2
Likes
0
Points
1
#1
I need to give users access to look up previous sales in a mysql database by PO $ and partnumber. Is there a way to use 2 form type fields to fill in USER INPUT 1 and USER INPUT 2?

PHP:
<?php
$con=mysqli_connect("xxx.xxx.xxx","xxxx","xxxx","xxxx");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT InvoiceNumber, `PO#`, PARTNUMBER from data where `PO#` = 'USER INPUT 1' and PARTNUMBER = 'USER INPUT 2'")or die(mysqli_error($con));


echo "<table border='1'>
<tr>
<th>INVOICE</th>
<th>PO #</th>
<th>PART NUMBER</th>

</tr>";

while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['InvoiceNumber'] . "</td>";
echo "<td>" . $row['PO#'] . "</td>";
echo "<td>" . $row['PARTNUMBER'] . "</td>";

echo "</tr>";
}
echo "</table>";

mysqli_close($con);
?>
 

alexkovalev

Program developer
Staff member
Messages
267
Likes
19
Points
18
#3
Hi,

Our plugin can exucute such it, but I can’t write code for you, because I don't have enough time for that.

I think you need to improve your skills in PHP, MYSQL to write a script with input processing.

Create simple login form with PHP and MySQL - MashLog
PHP Registration Form using GET, POST Methods with Example

You can also leave a ticket at Stack Overflow - Where Developers Learn, Share, & Build Careers. In the developer community, you will be helped to complete your script to solve your problem.

Best regards, Alex